wolfssh/.github/workflows/espressif.yml

98 lines
2.9 KiB
YAML

name: wolfSSH Espressif Build Test
on:
schedule:
# Weekly: Mondays at 07:00 UTC
- cron: '0 7 * * 1'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
WOLFSSL_REF: v5.9.1-stable
jobs:
build_examples:
name: ESP-IDF ${{ matrix.idf-ref }}
strategy:
fail-fast: false
matrix:
# release-v5.5 is the current stable line; release-v5.1 is the version
# the example READMEs and VisualGDB projects document.
idf-ref: [ release-v5.5, release-v5.1 ]
runs-on: ubuntu-latest
container:
image: espressif/idf:${{ matrix.idf-ref }}
timeout-minutes: 30
steps:
- name: Checkout wolfSSH
uses: actions/checkout@v6
with:
path: wolfssh
- name: Checkout wolfSSL
uses: actions/checkout@v6
with:
repository: wolfssl/wolfssl
ref: ${{ env.WOLFSSL_REF }}
path: wolfssl
- name: Build the Espressif examples
env:
WOLFSSH_ROOT: ${{ github.workspace }}/wolfssh
WOLFSSL_ROOT: ${{ github.workspace }}/wolfssl
run: |
# The image sets IDF_PATH, but the ESP-IDF tool paths come from
# export.sh, which a job step does not get from the entrypoint.
. "${IDF_PATH}/export.sh"
"${WOLFSSH_ROOT}/ide/Espressif/ESP-IDF/compileAllExamples.sh"
notify_failure:
name: Open issue on scheduled failure
needs: [build_examples]
if: failure() && github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
issues: write
steps:
- uses: actions/github-script@v7
with:
script: |
const label = 'espressif-build-failure';
const runUrl = `${context.serverUrl}/${context.repo.owner}/` +
`${context.repo.repo}/actions/runs/${context.runId}`;
const body = [
'The weekly Espressif example build failed.',
'',
`Run: ${runUrl}`,
`Commit: ${context.sha}`,
].join('\n');
const existing = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: label,
});
if (existing.data.length > 0) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: existing.data[0].number,
body: body,
});
} else {
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Weekly Espressif example build failed',
body: body,
labels: [label],
});
}