Skip to content

Commit 8d4974b

Browse files
authored
new compiler CI init (#7582)
* new compiler CI init * update name Signed-off-by: Anton-4 <[email protected]> * altered exe check * add macos dynamic dep check * add windows too * use builtin windows tools * ci_manager changes * move devtools too * fix deadlock * moved md link check * correct filename Signed-off-by: Anton-4 <[email protected]> * correct filename Signed-off-by: Anton-4 <[email protected]> * correct trigger Signed-off-by: Anton-4 <[email protected]> * fixed call_old_workflow if * naming fix * add output * fix finish if Signed-off-by: Anton-4 <[email protected]> * zig CI test change * fix auto cancellation * fix finish if * new compiler CI init update name Signed-off-by: Anton-4 <[email protected]> altered exe check add macos dynamic dep check add windows too use builtin windows tools ci_manager changes move devtools too fix deadlock moved md link check correct filename Signed-off-by: Anton-4 <[email protected]> correct filename Signed-off-by: Anton-4 <[email protected]> correct trigger Signed-off-by: Anton-4 <[email protected]> fixed call_old_workflow if naming fix add output fix finish if Signed-off-by: Anton-4 <[email protected]> zig CI test change fix auto cancellation fix finish if --------- Signed-off-by: Anton-4 <[email protected]>
1 parent 9d1e05a commit 8d4974b

File tree

7 files changed

+330
-178
lines changed

7 files changed

+330
-178
lines changed

.github/workflows/ci_manager.yml

Lines changed: 54 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,63 @@
1-
on:
2-
pull_request:
3-
4-
name: CI manager
1+
name: CI Manager
52

63
# cancel current runs when a new commit is pushed
74
concurrency:
85
group: ${{ github.workflow }}-${{ github.ref }}
96
cancel-in-progress: true
7+
8+
on:
9+
pull_request:
1010

1111
jobs:
12-
check-changes:
13-
runs-on: ubuntu-22.04
14-
outputs:
15-
run_tests: ${{ steps.filecheck.outputs.run_tests }}
16-
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v4
19-
20-
- name: Check if only css, html or md files changed
21-
id: check_ignored_files
22-
run: |
23-
git fetch origin ${{ github.base_ref }}
24-
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$)'; then
25-
echo "should_run_tests=y" >> $GITHUB_OUTPUT
26-
else
27-
echo "should_run_tests=n" >> $GITHUB_OUTPUT
28-
fi
29-
30-
- name: Check if only comments changed in rust files
31-
id: check_rs_comments
32-
run: |
33-
git fetch origin ${{ github.base_ref }}
34-
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$|\.rs|\.roc)'; then
35-
echo "should_run_tests=y" >> $GITHUB_OUTPUT
36-
else
37-
if git diff --unified=0 origin/${{ github.base_ref }} HEAD '*.rs' | grep -E --color=never '^[+-]' | grep -qvE '^(\+\+\+|\-\-\-|[+-]\s*($|\/\/[^\/]|\/\*.*\*\/\s*$))'; then
38-
echo "should_run_tests=y" >> $GITHUB_OUTPUT
39-
else
40-
echo "should_run_tests=n" >> $GITHUB_OUTPUT
41-
fi
42-
fi
43-
44-
- name: Check if only comments changed in roc files
45-
id: check_roc_comments
46-
run: |
47-
git fetch origin ${{ github.base_ref }}
48-
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$|\.rs|\.roc)'; then
49-
echo "should_run_tests=y" >> $GITHUB_OUTPUT
50-
else
51-
if git diff --unified=0 origin/${{ github.base_ref }} HEAD '*.roc' | grep -E --color=never '^[+-]' | grep -qvE '^(\+\+\+|\-\-\-|[+-]\s*($|#))'; then
52-
echo "should_run_tests=y" >> $GITHUB_OUTPUT
53-
else
54-
echo "should_run_tests=n" >> $GITHUB_OUTPUT
55-
fi
56-
fi
57-
58-
- name: Check if tests need to run based on earlier checks
59-
id: filecheck
60-
run: |
61-
if [ ${{ steps.check_ignored_files.outputs.should_run_tests }} = "y" ]; then
62-
if [ ${{ steps.check_rs_comments.outputs.should_run_tests }} = "y" ]; then
63-
echo "run_tests=full" >> $GITHUB_OUTPUT
64-
else
65-
if [ ${{ steps.check_roc_comments.outputs.should_run_tests }} = "y" ]; then
66-
echo "run_tests=full" >> $GITHUB_OUTPUT
67-
else
68-
echo "run_tests=none" >> $GITHUB_OUTPUT
69-
fi
70-
fi
71-
else
72-
echo "run_tests=none" >> $GITHUB_OUTPUT
73-
fi
74-
75-
- run: echo "debug output ${{ steps.filecheck.outputs.run_tests }}"
76-
77-
start-nix-linux-x86-64-tests:
78-
needs: check-changes
79-
if: needs.check-changes.outputs.run_tests == 'full'
80-
uses: ./.github/workflows/nix_linux_x86_64.yml
81-
82-
start-nix-linux-aarch64-build-default-test:
83-
needs: check-changes
84-
if: needs.check-changes.outputs.run_tests == 'full'
85-
uses: ./.github/workflows/nix_linux_arm64_default.yml
86-
87-
start-nix-linux-aarch64-cargo-build-test:
88-
needs: check-changes
89-
if: needs.check-changes.outputs.run_tests == 'full'
90-
uses: ./.github/workflows/nix_linux_arm64_cargo.yml
91-
92-
start-nix-macos-apple-silicon-tests:
93-
needs: check-changes
94-
if: needs.check-changes.outputs.run_tests == 'full'
95-
uses: ./.github/workflows/nix_macos_apple_silicon.yml
96-
97-
start-macos-x86-64-tests:
98-
needs: check-changes
99-
if: needs.check-changes.outputs.run_tests == 'full'
100-
uses: ./.github/workflows/macos_x86_64.yml
101-
102-
start-ubuntu-x86-64-tests:
103-
needs: check-changes
104-
if: needs.check-changes.outputs.run_tests == 'full'
105-
uses: ./.github/workflows/ubuntu_x86_64.yml
106-
107-
start-ubuntu-x86-64-nix-tests-debug:
108-
needs: check-changes
109-
if: needs.check-changes.outputs.run_tests == 'full'
110-
uses: ./.github/workflows/ubuntu_x86_64_nix_debug.yml
111-
112-
start-windows-release-build-test:
113-
needs: check-changes
114-
if: needs.check-changes.outputs.run_tests == 'full'
115-
uses: ./.github/workflows/windows_release_build.yml
116-
117-
start-windows-tests:
118-
needs: check-changes
119-
if: needs.check-changes.outputs.run_tests == 'full'
120-
uses: ./.github/workflows/windows_tests.yml
121-
122-
start-roc-benchmarks:
123-
needs: check-changes
124-
if: needs.check-changes.outputs.run_tests == 'full'
125-
uses: ./.github/workflows/benchmarks.yml
126-
127-
start-fuzzer-tests:
128-
needs: check-changes
129-
if: needs.check-changes.outputs.run_tests == 'full'
130-
uses: ./.github/workflows/fuzzer.yml
131-
132-
ran-full:
133-
runs-on: ubuntu-22.04
134-
needs: [
135-
start-nix-linux-x86-64-tests,
136-
start-nix-linux-aarch64-build-default-test,
137-
start-nix-linux-aarch64-cargo-build-test,
138-
start-nix-macos-apple-silicon-tests,
139-
start-macos-x86-64-tests,
140-
start-ubuntu-x86-64-tests,
141-
start-ubuntu-x86-64-nix-tests-debug,
142-
start-windows-release-build-test,
143-
start-windows-tests,
144-
start-roc-benchmarks
145-
]
146-
steps:
147-
- run: echo "all workflows succeeded!"
148-
149-
ran-none:
150-
runs-on: ubuntu-22.04
151-
needs: [check-changes]
152-
if: needs.check-changes.outputs.run_tests == 'none'
153-
steps:
154-
- run: echo "Only non-code files changed and/or rs and/or roc comment lines changed. CI manager did not run any workflows."
155-
156-
# we need a single end job for the required checks under branch protection rules
157-
finish:
158-
runs-on: ubuntu-22.04
159-
needs: [ran-full, ran-none]
160-
if: |
161-
always()
162-
steps:
163-
- name: Check previous job results
164-
run: |
165-
if [ "${{ needs.ran-full.result }}" != "success" ] && [ "${{ needs.ran-none.result }}" != "success" ]; then
166-
echo "One or more jobs failed."
12+
check-changes:
13+
runs-on: ubuntu-24.04
14+
permissions:
15+
pull-requests: read
16+
outputs:
17+
zig: ${{ steps.filter.outputs.zig }}
18+
other_than_zig: ${{ steps.filter.outputs.other_than_zig }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: dorny/paths-filter@v2
22+
id: filter
23+
with:
24+
filters: |
25+
zig:
26+
- 'src/**'
27+
- 'build.zig'
28+
- 'build.zig.zon'
29+
other_than_zig:
30+
- '**/*'
31+
- '!src/**'
32+
- '!build.zig'
33+
- '!build.zig.zon'
34+
35+
call-zig-workflow:
36+
needs: check-changes
37+
if: needs.check-changes.outputs.zig == 'true'
38+
uses: ./.github/workflows/ci_zig.yml
39+
40+
call-old-workflow:
41+
needs: check-changes
42+
if: needs.check-changes.outputs.other_than_zig == 'true'
43+
uses: ./.github/workflows/ci_manager_old.yml
44+
45+
finish:
46+
needs: [check-changes, call-zig-workflow, call-old-workflow]
47+
runs-on: ubuntu-latest
48+
if: always()
49+
steps:
50+
- name: Check workflow results
51+
run: |
52+
if [[ "${{ needs.check-changes.outputs.zig }}" == "true" ]]; then
53+
if [[ "${{ needs.call-zig-workflow.result }}" != "success" ]]; then
54+
echo "ci_zig.yml failed."
16755
exit 1
16856
fi
169-
170-
- run: echo "Workflow succeeded :)"
57+
fi
58+
if [[ "${{ needs.check-changes.outputs.other_than_zig }}" == "true" ]]; then
59+
if [[ "${{ needs.call-old-workflow.result }}" != "success" ]]; then
60+
echo "ci_manager_old.yml failed."
61+
exit 1
62+
fi
63+
fi

0 commit comments

Comments
 (0)