|
1 | 1 | name: Main-CI-Flow |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
7 | | - - main-v[0-9].** |
8 | | - tags: |
9 | | - - v[0-9].** |
10 | | - |
11 | 4 | pull_request: |
12 | 5 | types: |
13 | 6 | - opened |
|
22 | 15 | EXTRA_RUST_TOOLCHAINS: nightly-2024-04-29 |
23 | 16 |
|
24 | 17 | # On PR events, cancel existing CI runs on this same PR for this workflow. |
25 | | -# Also, create different concurrency groups for different pushed commits, on push events. |
26 | 18 | concurrency: |
27 | 19 | group: > |
28 | 20 | ${{ github.workflow }}- |
@@ -66,32 +58,21 @@ jobs: |
66 | 58 | git diff --exit-code Cargo.lock |
67 | 59 |
|
68 | 60 | # Run code style on PR. |
69 | | - - name: "Run TODO style pull request" |
70 | | - if: github.event_name == 'pull_request' |
| 61 | + - name: "Run TODO style" |
71 | 62 | run: scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }} |
72 | | - - name: "Run clippy pull request" |
73 | | - if: github.event_name == 'pull_request' |
| 63 | + - name: "Run clippy" |
74 | 64 | run: scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.pull_request.base.sha }} |
75 | | - - name: "Run cargo doc pull request" |
76 | | - if: github.event_name == 'pull_request' |
| 65 | + - name: "Run cargo doc" |
77 | 66 | run: scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.pull_request.base.sha }} |
78 | | - - name: "Run python code style pull request" |
79 | | - if: github.event_name == 'pull_request' |
| 67 | + - name: "Run python code style" |
80 | 68 | run: scripts/py_code_style.py |
81 | 69 |
|
82 | | - # Run code style on push. |
| 70 | + # Run code style |
83 | 71 | - name: "Run rustfmt" |
84 | 72 | # The nightly here is coupled with the one in install_rust/action.yml. |
85 | 73 | # If we move the install here we can use a const. |
86 | 74 | run: cargo +"$EXTRA_RUST_TOOLCHAINS" fmt --all -- --check |
87 | 75 |
|
88 | | - - name: "Run clippy on push" |
89 | | - if: github.event_name == 'push' |
90 | | - run: scripts/run_tests.py --command clippy |
91 | | - - name: "Run cargo doc on push" |
92 | | - if: github.event_name == 'push' |
93 | | - run: scripts/run_tests.py --command doc |
94 | | - |
95 | 76 | - name: "Run taplo" |
96 | 77 | run: scripts/taplo.sh |
97 | 78 | - name: Run Machete (detect unused dependencies) |
@@ -129,23 +110,13 @@ jobs: |
129 | 110 | run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV |
130 | 111 | - run: pip install -r scripts/requirements.txt |
131 | 112 |
|
132 | | - - name: "Run tests pull request" |
133 | | - if: github.event_name == 'pull_request' |
| 113 | + - name: "Run tests" |
134 | 114 | run: | |
135 | 115 | scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }} |
136 | 116 | env: |
137 | 117 | SEED: 0 |
138 | 118 |
|
139 | | - - name: "Run tests on push" |
140 | | - if: github.event_name == 'push' |
141 | | - # TODO(AdiY/Dori): Better support for running tests on push. |
142 | | - run: | |
143 | | - scripts/run_tests.py --command test |
144 | | - env: |
145 | | - SEED: 0 |
146 | | - |
147 | 119 | integration-tests-pr: |
148 | | - if: github.event_name == 'pull_request' |
149 | 120 | uses: ./.github/workflows/integration-tests.yml |
150 | 121 | with: |
151 | 122 | branch: ${{ github.head_ref }} |
|
0 commit comments