mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
72 lines
2 KiB
YAML
72 lines
2 KiB
YAML
name: CI Manager
|
|
|
|
# cancel current runs when a new commit is pushed
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
check-changes:
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
pull-requests: read
|
|
outputs:
|
|
zig: ${{ steps.filter.outputs.zig }}
|
|
other_than_zig: ${{ steps.other_filter.outputs.other_than_zig }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
zig:
|
|
- 'src/**'
|
|
- 'build.zig'
|
|
- 'build.zig.zon'
|
|
- '.github/workflows/ci_zig.yml'
|
|
- 'ci/zig-lints.sh'
|
|
- uses: dorny/paths-filter@v3
|
|
id: other_filter
|
|
with:
|
|
predicate-quantifier: 'every'
|
|
filters: |
|
|
other_than_zig:
|
|
- '**/*'
|
|
- '!src/**'
|
|
- '!build.zig'
|
|
- '!build.zig.zon'
|
|
- '!.github/workflows/ci_zig.yml'
|
|
- '!ci/zig-lints.sh'
|
|
|
|
call-zig-workflow:
|
|
needs: check-changes
|
|
if: needs.check-changes.outputs.zig == 'true'
|
|
uses: ./.github/workflows/ci_zig.yml
|
|
|
|
call-old-workflow:
|
|
needs: check-changes
|
|
if: needs.check-changes.outputs.other_than_zig == 'true'
|
|
uses: ./.github/workflows/ci_manager_old.yml
|
|
|
|
finish:
|
|
needs: [check-changes, call-zig-workflow, call-old-workflow]
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
steps:
|
|
- name: Check workflow results
|
|
run: |
|
|
if [[ "${{ needs.check-changes.outputs.zig }}" == "true" ]]; then
|
|
if [[ "${{ needs.call-zig-workflow.result }}" != "success" ]]; then
|
|
echo "ci_zig.yml failed."
|
|
exit 1
|
|
fi
|
|
fi
|
|
if [[ "${{ needs.check-changes.outputs.other_than_zig }}" == "true" ]]; then
|
|
if [[ "${{ needs.call-old-workflow.result }}" != "success" ]]; then
|
|
echo "ci_manager_old.yml failed."
|
|
exit 1
|
|
fi
|
|
fi
|