Tool: Move image generation out of main #50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2021, Proofcraft Pty Ltd | |
| # Copyright 2026, UNSW | |
| # | |
| # SPDX-License-Identifier: BSD-2-Clause | |
| # Deploy default.xml to microkit-manifest after successful runs. | |
| name: Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'platforms.yml' | |
| - '.linkcheck-ignore.yml' | |
| tags: | |
| # Run on version tags, for releases. | |
| - '*.*.*' | |
| # allow manual trigger | |
| workflow_dispatch: | |
| # allow explicit trigger from other repos when dependencies have changed | |
| repository_dispatch: | |
| types: [deps-update] | |
| jobs: | |
| code: | |
| name: Freeze Code | |
| runs-on: ubuntu-latest | |
| outputs: | |
| xml: ${{ steps.repo.outputs.xml }} | |
| steps: | |
| - id: repo | |
| uses: seL4/ci-actions/repo-checkout@master | |
| with: | |
| manifest_repo: seL4/microkit-manifest | |
| manifest_branch: main | |
| manifest: main.xml | |
| sdk-build: | |
| name: Build SDK | |
| needs: code | |
| uses: ./.github/workflows/_sdk.yaml | |
| with: | |
| xml: ${{ needs.code.outputs.xml }} | |
| # TODO: We want to add support for this but have yet to do so. | |
| # sim: | |
| # name: Simulation | |
| # needs: code | |
| # runs-on: ubuntu-latest | |
| # strategy: | |
| # matrix: | |
| # march: [aarch64, x86_64, riscv64] | |
| # compiler: [gcc] | |
| # steps: | |
| # - uses: seL4/ci-actions/microkit-sim@master | |
| # with: | |
| # xml: ${{ needs.code.outputs.xml }} | |
| # march: ${{ matrix.march }} | |
| # compiler: ${{ matrix.compiler }} | |
| the_matrix: | |
| name: Matrix | |
| needs: sdk-build | |
| runs-on: ubuntu-latest | |
| outputs: | |
| gh_matrix: ${{ steps.matrix.outputs.gh_matrix }} | |
| test_cases: ${{ steps.matrix.outputs.test_cases }} | |
| steps: | |
| - name: Checkout code | |
| uses: seL4/ci-actions/repo-checkout@master | |
| with: | |
| xml: ${{ needs.sdk-build.outputs.xml }} | |
| # needed for reasons... | |
| manifest_repo: seL4/microkit-manifest | |
| manifest_branch: main | |
| manifest: main.xml | |
| - id: matrix | |
| uses: seL4/ci-actions/microkit-hw-matrix@master | |
| env: | |
| # We don't actually care what this is set to, but for the files for | |
| # each platform it expects this path to exist, so we set it up. | |
| MICROKIT_SDK: /dummy-microkit-sdk-for-matrix | |
| hw-build: | |
| name: HW Test Builds | |
| if: ${{ github.repository_owner == 'seL4' }} | |
| runs-on: ubuntu-latest | |
| # FIXME: Add simulation support | |
| # needs: [sim, the_matrix, sdk-build] | |
| needs: [the_matrix, sdk-build, code] | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.the_matrix.outputs.gh_matrix) }} | |
| env: | |
| SDK_VERSION: ${{ needs.sdk-build.outputs.SDK_VERSION }} | |
| steps: | |
| - name: Checkout code | |
| uses: seL4/ci-actions/repo-checkout@master | |
| with: | |
| xml: ${{ needs.code.outputs.xml }} | |
| # needed for reasons... | |
| manifest_repo: seL4/microkit-manifest | |
| manifest_branch: main | |
| manifest: main.xml | |
| - name: Download microkit SDK | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64 | |
| - name: Extract microkit SDK | |
| run: | | |
| tar xzf ./microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64.tar.gz | |
| export "MICROKIT_SDK=$(realpath ./microkit-sdk-${{ env.SDK_VERSION }}/)" | |
| echo "MICROKIT_SDK=${MICROKIT_SDK}" >> "${GITHUB_ENV}" | |
| - name: Install build dependencies | |
| run: ./ci/install_march_build_deps.sh ${{ matrix.march }} | |
| working-directory: ./microkit/ | |
| - name: Build | |
| uses: seL4/ci-actions/microkit-hw-build@master | |
| with: | |
| board: ${{ matrix.board }} | |
| env: | |
| TEST_CASES: ${{ needs.the_matrix.outputs.test_cases }} | |
| - name: Upload test case builds | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: loader-img-${{ matrix.board }} | |
| path: '*.loader.img' | |
| hw-run: | |
| name: HW Run | |
| if: ${{ github.repository_owner == 'seL4' }} | |
| runs-on: ubuntu-latest | |
| needs: [the_matrix, hw-build, sdk-build] | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.the_matrix.outputs.gh_matrix) }} | |
| # do not run concurrently with other workflows, but do run concurrently in the build matrix | |
| concurrency: hw-run-${{ strategy.job-index }} | |
| env: | |
| SDK_VERSION: ${{ needs.sdk-build.outputs.SDK_VERSION }} | |
| steps: | |
| - name: Get machine queue | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: seL4/machine_queue | |
| path: machine_queue | |
| - name: Download test cases builds | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: loader-img-${{ matrix.board }} | |
| - name: Download microkit SDK | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64 | |
| - name: Extract microkit SDK | |
| run: | | |
| tar xzf ./microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64.tar.gz | |
| export "MICROKIT_SDK=$(realpath ./microkit-sdk-${{ env.SDK_VERSION }}/)" | |
| echo "MICROKIT_SDK=${MICROKIT_SDK}" >> "${GITHUB_ENV}" | |
| - name: Run | |
| uses: seL4/ci-actions/microkit-hw-run@master | |
| with: | |
| board: ${{ matrix.board }} | |
| index: ${{ strategy.job-index }} | |
| env: | |
| TEST_CASES: ${{ needs.the_matrix.outputs.test_cases }} | |
| HW_SSH: ${{ secrets.HW_SSH }} | |
| deploy: | |
| name: Deploy manifest | |
| if: ${{ github.repository_owner == 'seL4' }} | |
| runs-on: ubuntu-24.04 | |
| needs: [code, hw-run, sdk-build] | |
| steps: | |
| - name: Deploy | |
| uses: seL4/ci-actions/manifest-deploy@master | |
| with: | |
| xml: ${{ needs.code.outputs.xml }} | |
| manifest_repo: seL4/microkit-manifest | |
| manifest_branch: main | |
| manifest: main.xml | |
| env: | |
| GH_SSH: ${{ secrets.CI_SSH }} |