CI #2373
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_target: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: 0 0 * * * | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.head.ref || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request_target' }} | |
| env: | |
| ALUMNIUM_LOG_DEBUG_EXTRA: all | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| outputs: | |
| permitted: ${{ steps.check-access.outputs.require-result }} | |
| java-changed: ${{ steps.changed-files.outputs.java_any_changed }} | |
| python-changed: ${{ steps.changed-files.outputs.python_any_changed }} | |
| typescript-changed: ${{ steps.changed-files.outputs.typescript_any_changed }} | |
| # Prevent running the workflow for PRs from ci/ or ci- branches, since those | |
| # trigger the workflow on branch push events. | |
| if: > | |
| github.event_name != 'pull_request_target' | |
| || (!startsWith(github.event.pull_request.head.ref, 'ci/') | |
| && !startsWith(github.event.pull_request.head.ref, 'ci-')) | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Set Up Dev Env | |
| uses: ./.github/actions/setup | |
| with: | |
| python-cache: true | |
| - name: Check Access | |
| id: check-access | |
| uses: actions-cool/check-user-permission@v2 | |
| with: | |
| require: write | |
| username: ${{ github.triggering_actor }} | |
| - name: Determine Changed Files | |
| id: changed-files | |
| uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5 | |
| with: | |
| files_yaml: | | |
| java: | |
| - packages/java/** | |
| python: | |
| - packages/python/** | |
| typescript: | |
| - packages/typescript/** | |
| - name: Build | |
| run: mise :build | |
| - name: Check Formatting | |
| run: mise :format/check | |
| - name: Lint | |
| run: mise :lint | |
| - name: Check Types | |
| run: mise :types | |
| - name: Unit Tests | |
| run: mise :test/unit | |
| - name: Upload Binaries Artifacts | |
| uses: ./.github/actions/dist-artifacts | |
| with: | |
| name: build | |
| bin: true | |
| - name: Upload Test Artifacts | |
| if: always() | |
| uses: ./.github/actions/test-artifacts | |
| with: | |
| name: ci | |
| typescript: true | |
| python: true | |
| - name: Run Post-Setup | |
| if: always() | |
| uses: ./.github/actions/setup/post | |
| - name: Debug Session | |
| if: failure() && runner.debug == '1' | |
| uses: mxschmitt/action-tmate@v3 | |
| eval: | |
| name: Eval | |
| needs: test | |
| secrets: inherit | |
| if: needs.test.outputs.permitted == 'true' | |
| uses: ./.github/workflows/ci-eval.yml | |
| with: | |
| sha: ${{ github.event.pull_request.head.sha || github.sha }} | |
| java: | |
| name: Java | |
| needs: test | |
| secrets: inherit | |
| if: > | |
| needs.test.outputs.permitted == 'true' | |
| && needs.test.outputs.java-changed == 'true' | |
| uses: ./.github/workflows/ci-java.yml | |
| with: | |
| sha: ${{ github.event.pull_request.head.sha || github.sha }} | |
| python: | |
| name: Python | |
| needs: test | |
| secrets: inherit | |
| if: > | |
| needs.test.outputs.permitted == 'true' | |
| && (needs.test.outputs.typescript-changed == 'true' || needs.test.outputs.python-changed == 'true') | |
| uses: ./.github/workflows/ci-python.yml | |
| with: | |
| sha: ${{ github.event.pull_request.head.sha || github.sha }} | |
| typescript: | |
| name: TypeScript | |
| needs: test | |
| secrets: inherit | |
| if: > | |
| needs.test.outputs.permitted == 'true' | |
| && needs.test.outputs.typescript-changed == 'true' | |
| uses: ./.github/workflows/ci-typescript.yml | |
| with: | |
| sha: ${{ github.event.pull_request.head.sha || github.sha }} |