|
1 | 1 | name: CI
|
2 | 2 | on:
|
3 |
| - push: |
4 |
| - branches: |
5 |
| - - master |
6 |
| - pull_request: { } |
| 3 | + merge_group: |
| 4 | + pull_request: |
7 | 5 | schedule:
|
8 | 6 | - cron: "0 12 * * 1" # Every Monday at 12:00 UTC
|
9 | 7 |
|
10 | 8 | env:
|
11 | 9 | AWS_ACCESS_KEY_ID: AKIA46X5W6CZBLO3VBND
|
12 | 10 |
|
13 | 11 | jobs:
|
14 |
| - test_and_deploy: |
| 12 | + test-linux: |
15 | 13 | name: Test and deploy
|
16 | 14 | runs-on: ubuntu-22.04
|
17 | 15 | env:
|
@@ -52,35 +50,12 @@ jobs:
|
52 | 50 | - name: Formatting check
|
53 | 51 | run: cargo fmt --all -- --check
|
54 | 52 |
|
55 |
| - - uses: docker/setup-buildx-action@v2 |
56 |
| - - name: Build Docker image |
57 |
| - uses: docker/build-push-action@v4 |
58 |
| - with: |
59 |
| - context: . |
60 |
| - # Export the image to Docker to make it available in the next step |
61 |
| - load: true |
62 |
| - tags: rustc-perf |
63 |
| - cache-from: type=gha |
64 |
| - cache-to: type=gha,mode=max |
65 |
| - |
66 | 53 | - name: Check licenses
|
67 | 54 | run: |
|
68 | 55 | pip install reuse==4.0.3
|
69 | 56 | reuse lint
|
70 | 57 |
|
71 |
| - - name: Deploy to production |
72 |
| - uses: rust-lang/simpleinfra/github-actions/upload-docker-image@master |
73 |
| - with: |
74 |
| - image: rustc-perf |
75 |
| - repository: rust-rustc-perf |
76 |
| - region: us-west-1 |
77 |
| - redeploy_ecs_cluster: rust-ecs-prod |
78 |
| - redeploy_ecs_service: rustc-perf |
79 |
| - aws_access_key_id: "${{ env.AWS_ACCESS_KEY_ID }}" |
80 |
| - aws_secret_access_key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" |
81 |
| - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/deploy' |
82 |
| - |
83 |
| - test_on_windows: |
| 58 | + test-windows: |
84 | 59 | name: Test on Windows
|
85 | 60 | runs-on: windows-latest
|
86 | 61 | steps:
|
|
110 | 85 | - name: Run unit tests
|
111 | 86 | run: cargo test --all
|
112 | 87 |
|
113 |
| - test_benchmarks: |
| 88 | + test-benchmarks: |
114 | 89 | strategy:
|
115 | 90 | matrix:
|
116 | 91 | # We split `bench_local` testing into four jobs that run in parallel,
|
@@ -170,7 +145,7 @@ jobs:
|
170 | 145 | PROFILES: ${{ matrix.PROFILES }}
|
171 | 146 | SHELL: "/bin/bash"
|
172 | 147 |
|
173 |
| - test_backends: |
| 148 | + test-backends: |
174 | 149 | name: Test codegen backend benchmarks
|
175 | 150 | runs-on: ubuntu-22.04
|
176 | 151 | steps:
|
@@ -206,7 +181,7 @@ jobs:
|
206 | 181 | BACKENDS: Cranelift
|
207 | 182 | SHELL: "/bin/bash"
|
208 | 183 |
|
209 |
| - test_runtime_benchmarks: |
| 184 | + test-runtime-benchmarks: |
210 | 185 | name: Test runtime benchmarks
|
211 | 186 | runs-on: ubuntu-22.04
|
212 | 187 | steps:
|
@@ -239,7 +214,7 @@ jobs:
|
239 | 214 | env:
|
240 | 215 | SHELL: "/bin/bash"
|
241 | 216 |
|
242 |
| - test_profiling: |
| 217 | + test-profiling: |
243 | 218 | name: Test profiling
|
244 | 219 | runs-on: ubuntu-22.04
|
245 | 220 | steps:
|
@@ -415,3 +390,43 @@ jobs:
|
415 | 390 | run: |
|
416 | 391 | DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres cargo run --bin site &
|
417 | 392 | python3 ci/check-site.py version1 version2
|
| 393 | +
|
| 394 | + docker: |
| 395 | + runs-on: ubuntu-latest |
| 396 | + steps: |
| 397 | + - uses: docker/setup-buildx-action@v2 |
| 398 | + - name: Build Docker image |
| 399 | + uses: docker/build-push-action@v4 |
| 400 | + with: |
| 401 | + context: . |
| 402 | + tags: rustc-perf |
| 403 | + cache-from: type=gha |
| 404 | + cache-to: type=gha,mode=max |
| 405 | + |
| 406 | + # Summary job for the merge queue. |
| 407 | + # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! |
| 408 | + conclusion: |
| 409 | + needs: |
| 410 | + - test-linux |
| 411 | + - test-windows |
| 412 | + - test-benchmarks |
| 413 | + - test-backends |
| 414 | + - test-runtime-benchmarks |
| 415 | + - test-profiling |
| 416 | + - database-check |
| 417 | + - site-endpoint |
| 418 | + - docker |
| 419 | + # We need to ensure this job does *not* get skipped if its dependencies fail, |
| 420 | + # because a skipped job is considered a success by GitHub. So we have to |
| 421 | + # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run |
| 422 | + # when the workflow is canceled manually. |
| 423 | + if: ${{ !cancelled() }} |
| 424 | + runs-on: ubuntu-latest |
| 425 | + steps: |
| 426 | + # Manually check the status of all dependencies. `if: failure()` does not work. |
| 427 | + - name: Conclusion |
| 428 | + run: | |
| 429 | + # Print the dependent jobs to see them in the CI log |
| 430 | + jq -C <<< '${{ toJson(needs) }}' |
| 431 | + # Check if all jobs that we depend on (in the needs array) were successful. |
| 432 | + jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
0 commit comments