CI #2328
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: | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - '**' | |
| jobs: | |
| devcontainer: | |
| name: Devcontainer image | |
| uses: ./.github/workflows/devcontainer-image.yml | |
| app-targets: | |
| name: App targets | |
| runs-on: ubuntu-latest | |
| outputs: | |
| targets: ${{ steps.targets.outputs.targets }} | |
| steps: | |
| - name: Pull the repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: List app targets | |
| id: targets | |
| run: | | |
| set -euo pipefail | |
| targets=$(./scripts/bulk_build.sh --type=app --print-target-matrix) | |
| echo "targets=${targets}" >> "${GITHUB_OUTPUT}" | |
| app: | |
| name: App | |
| needs: | |
| - app-targets | |
| - devcontainer | |
| uses: ./.github/workflows/app-build.yml | |
| with: | |
| image_name: ${{ needs.devcontainer.outputs.image_name }} | |
| image_tag: ${{ needs.devcontainer.outputs.image_tag }} | |
| targets: ${{ needs.app-targets.outputs.targets }} | |
| host-test-targets: | |
| name: Host test targets | |
| runs-on: ubuntu-latest | |
| outputs: | |
| targets: ${{ steps.targets.outputs.targets }} | |
| steps: | |
| - name: Pull the repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: List host test targets | |
| id: targets | |
| run: | | |
| set -euo pipefail | |
| targets=$(./scripts/bulk_build.sh --type=host-test --print-target-matrix) | |
| echo "targets=${targets}" >> "${GITHUB_OUTPUT}" | |
| host-test-shared: | |
| name: Tests (shared) | |
| runs-on: ubuntu-latest | |
| needs: | |
| - host-test-targets | |
| - devcontainer | |
| container: &native-container | |
| image: ${{ needs.devcontainer.outputs.image_name }}:${{ needs.devcontainer.outputs.image_tag }} | |
| credentials: | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| options: --user root | |
| env: &native-env | |
| HOME: /home/ubuntu | |
| defaults: &native-defaults | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Pull the repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare zenv | |
| uses: ./.github/actions/prepare-zenv-native | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: host-test-shared | |
| restore-keys: host-test-shared | |
| max-size: 1G | |
| - name: Run shared host tests | |
| run: | | |
| set -euo pipefail | |
| ./scripts/bulk_build.sh --type=host-test --test-scope=shared | |
| host-test-target: | |
| name: Tests (${{ matrix.target }}) | |
| runs-on: ubuntu-latest | |
| needs: | |
| - host-test-targets | |
| - devcontainer | |
| container: *native-container | |
| env: *native-env | |
| defaults: *native-defaults | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: ${{ fromJson(needs.host-test-targets.outputs.targets) }} | |
| steps: | |
| - name: Pull the repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare zenv | |
| uses: ./.github/actions/prepare-zenv-native | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: host-test-${{ matrix.target }} | |
| restore-keys: host-test-${{ matrix.target }} | |
| max-size: 1G | |
| - name: Run host test | |
| run: | | |
| set -euo pipefail | |
| make configure-app TARGET=${{ matrix.target }} | |
| ./scripts/bulk_build.sh --type=host-test --test-scope=preset --test-target=${{ matrix.target }} | |
| format: | |
| name: Code formatting | |
| runs-on: ubuntu-latest | |
| needs: devcontainer | |
| container: *native-container | |
| env: *native-env | |
| defaults: *native-defaults | |
| steps: | |
| - name: Pull the repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare zenv | |
| uses: ./.github/actions/prepare-zenv-native | |
| - name: Check formatting | |
| run: make format | |
| lint-targets: | |
| name: Lint targets | |
| runs-on: ubuntu-latest | |
| outputs: | |
| targets: ${{ steps.targets.outputs.targets }} | |
| steps: | |
| - name: Pull the repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: List lint targets | |
| id: targets | |
| run: | | |
| set -euo pipefail | |
| targets=$(./scripts/bulk_build.sh --type=lint --print-target-matrix) | |
| echo "targets=${targets}" >> "${GITHUB_OUTPUT}" | |
| lint: | |
| name: Lint (${{ matrix.target }}) | |
| runs-on: ubuntu-latest | |
| needs: | |
| - lint-targets | |
| - devcontainer | |
| container: *native-container | |
| env: *native-env | |
| defaults: *native-defaults | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: ${{ fromJson(needs.lint-targets.outputs.targets) }} | |
| steps: | |
| - name: Pull the repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare zenv | |
| uses: ./.github/actions/prepare-zenv-native | |
| - name: Setup ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: lint-${{ matrix.target }} | |
| restore-keys: lint-${{ matrix.target }} | |
| max-size: 1G | |
| - name: Run lint | |
| run: | | |
| set -euo pipefail | |
| make CHECK=1 TARGET=${{ matrix.target }} |