-
-
Notifications
You must be signed in to change notification settings - Fork 313
118 lines (96 loc) · 3.81 KB
/
ci_manager.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
on:
pull_request:
name: CI manager
# cancel current runs when a new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-changes:
runs-on: ubuntu-22.04
outputs:
run_tests: ${{ steps.filecheck.outputs.run_tests }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check if only css, html or md files changed
id: filecheck
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$)'; then
echo "run_tests=full" >> $GITHUB_OUTPUT
else
echo "run_tests=none" >> $GITHUB_OUTPUT
fi
- run: echo "debug output ${{ steps.filecheck.outputs.run_tests }}"
start-nix-linux-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_x86_64.yml
start-nix-linux-aarch64-build-default-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_arm64_default.yml
start-nix-linux-aarch64-cargo-build-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_arm64_cargo.yml
start-nix-macos-apple-silicon-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_macos_apple_silicon.yml
start-macos-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/macos_x86_64.yml
start-ubuntu-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/ubuntu_x86_64.yml
start-windows-release-build-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/windows_release_build.yml
start-windows-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/windows_tests.yml
start-roc-benchmarks:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/benchmarks.yml
ran-full:
runs-on: ubuntu-22.04
needs: [
start-nix-linux-x86-64-tests,
start-nix-linux-aarch64-build-default-test,
start-nix-linux-aarch64-cargo-build-test,
start-nix-macos-apple-silicon-tests,
start-macos-x86-64-tests,
start-ubuntu-x86-64-tests,
start-windows-release-build-test,
start-windows-tests,
start-roc-benchmarks
]
steps:
- run: echo "all workflows succeeded!"
ran-none:
runs-on: ubuntu-22.04
needs: [check-changes]
if: needs.check-changes.outputs.run_tests == 'none'
steps:
- run: echo "Only non-code files changed. CI manager did not run any workflows."
# we need a single end job for the required checks under branch protection rules
finish:
runs-on: ubuntu-22.04
needs: [ran-full, ran-none]
if: |
always()
steps:
- name: Check previous job results
run: |
if [ "${{ needs.ran-full.result }}" != "success" ] && [ "${{ needs.ran-none.result }}" != "success" ]; then
echo "One or more jobs failed."
exit 1
fi
- run: echo "Workflow succeeded :)"