Migrate static configs #1940
Workflow file for this run
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
| name: CI | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| push: | |
| branches: | |
| - main | |
| - ci-work | |
| workflow_dispatch: | |
| # A label event that neither starts nor stops a run is skipped by | |
| # check-trigger, keep those in a group of their own so they cannot cancel | |
| # a run in progress. Adding 'ci:skip' does share the group, on purpose, | |
| # to stop a build that is no longer wanted. | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }}${{ (github.event.action == 'labeled' && github.event.label.name != 'ci:main' && github.event.label.name != 'ci:skip') && '-label' || '' }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Gate all builds through this check to prevent wasted runs. Only run on | |
| # 'labeled' events when the label is actually 'ci:main'. Concurrency control | |
| # above handles canceling the 'opened' event when 'ci:main' arrives quickly | |
| # after (e.g., when creating a PR with ci:main already attached). See #1154. | |
| # | |
| # A PR labeled 'ci:skip' builds nothing, for changes that cannot affect | |
| # the image, e.g. a ChangeLog fixup after someone else's branch landed. | |
| check-trigger: | |
| if: | | |
| startsWith(github.repository, 'kernelkit/') && | |
| !contains(github.event.pull_request.labels.*.name, 'ci:skip') && | |
| (github.event_name != 'pull_request' || | |
| github.event.action != 'labeled' || | |
| github.event.label.name == 'ci:main') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| x86_64_target: ${{ steps.set-targets.outputs.x86_64_target }} | |
| aarch64_target: ${{ steps.set-targets.outputs.aarch64_target }} | |
| arm_target: ${{ steps.set-targets.outputs.arm_target }} | |
| steps: | |
| - run: | | |
| echo "Triggering build, logging meta data ..." | |
| echo "Event : ${{ github.event_name }}" | |
| echo "Action : ${{ github.event.action }}" | |
| echo "Ref : ${{ github.ref }}" | |
| echo "PR : ${{ github.event.pull_request.number }}" | |
| echo "Label : ${{ github.event.label.name }}" | |
| - id: set-targets | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]] && \ | |
| ! echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' \ | |
| | grep -q "ci:main"; then | |
| echo "x86_64_target=x86_64_minimal" >> $GITHUB_OUTPUT | |
| echo "aarch64_target=aarch64_minimal" >> $GITHUB_OUTPUT | |
| echo "arm_target=arm_minimal" >> $GITHUB_OUTPUT | |
| else | |
| echo "x86_64_target=x86_64" >> $GITHUB_OUTPUT | |
| echo "aarch64_target=aarch64" >> $GITHUB_OUTPUT | |
| echo "arm_target=arm" >> $GITHUB_OUTPUT | |
| fi | |
| unit-test: | |
| needs: check-trigger | |
| uses: ./.github/workflows/unit-test.yml | |
| with: | |
| name: "infix" | |
| target: ${{ needs.check-trigger.outputs.x86_64_target }} | |
| build-x86_64: | |
| needs: [check-trigger, unit-test] | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| name: "infix" | |
| target: ${{ needs.check-trigger.outputs.x86_64_target }} | |
| build-aarch64: | |
| needs: [check-trigger, unit-test] | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| name: "infix" | |
| target: ${{ needs.check-trigger.outputs.aarch64_target }} | |
| build-arm: | |
| needs: [check-trigger, unit-test] | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| name: "infix" | |
| target: ${{ needs.check-trigger.outputs.arm_target }} | |
| test-run-x86_64: | |
| needs: [check-trigger, build-x86_64] | |
| uses: ./.github/workflows/test.yml | |
| with: | |
| target: ${{ needs.check-trigger.outputs.x86_64_target }} | |
| name: "infix" | |
| test-publish-x86_64: | |
| if: ${{ github.repository_owner == 'kernelkit' && github.ref_name == 'main' }} | |
| needs: test-run-x86_64 | |
| uses: ./.github/workflows/publish.yml |