Skip to content

Commit 8077fab

Browse files
committed
Use merge queue on CI
1 parent ef604b4 commit 8077fab

File tree

2 files changed

+52
-34
lines changed

2 files changed

+52
-34
lines changed

.github/workflows/ci.yml

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
name: CI
22
on:
3-
push:
4-
branches:
5-
- master
6-
pull_request: { }
3+
merge_group:
4+
pull_request:
75
schedule:
86
- cron: "0 12 * * 1" # Every Monday at 12:00 UTC
97

108
env:
119
AWS_ACCESS_KEY_ID: AKIA46X5W6CZBLO3VBND
1210

1311
jobs:
14-
test_and_deploy:
12+
test-linux:
1513
name: Test and deploy
1614
runs-on: ubuntu-22.04
1715
env:
@@ -52,35 +50,12 @@ jobs:
5250
- name: Formatting check
5351
run: cargo fmt --all -- --check
5452

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-
6653
- name: Check licenses
6754
run: |
6855
pip install reuse==4.0.3
6956
reuse lint
7057
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:
8459
name: Test on Windows
8560
runs-on: windows-latest
8661
steps:
@@ -110,7 +85,7 @@ jobs:
11085
- name: Run unit tests
11186
run: cargo test --all
11287

113-
test_benchmarks:
88+
test-benchmarks:
11489
strategy:
11590
matrix:
11691
# We split `bench_local` testing into four jobs that run in parallel,
@@ -170,7 +145,7 @@ jobs:
170145
PROFILES: ${{ matrix.PROFILES }}
171146
SHELL: "/bin/bash"
172147

173-
test_backends:
148+
test-backends:
174149
name: Test codegen backend benchmarks
175150
runs-on: ubuntu-22.04
176151
steps:
@@ -206,7 +181,7 @@ jobs:
206181
BACKENDS: Cranelift
207182
SHELL: "/bin/bash"
208183

209-
test_runtime_benchmarks:
184+
test-runtime-benchmarks:
210185
name: Test runtime benchmarks
211186
runs-on: ubuntu-22.04
212187
steps:
@@ -239,7 +214,7 @@ jobs:
239214
env:
240215
SHELL: "/bin/bash"
241216

242-
test_profiling:
217+
test-profiling:
243218
name: Test profiling
244219
runs-on: ubuntu-22.04
245220
steps:
@@ -415,3 +390,43 @@ jobs:
415390
run: |
416391
DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres cargo run --bin site &
417392
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) }}'

.github/workflows/manual-deploy.yml renamed to .github/workflows/deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Manual deploy
22
on:
3+
push:
4+
branches:
5+
- master
36
workflow_dispatch:
47

58
env:
@@ -8,7 +11,7 @@ env:
811
jobs:
912
deploy:
1013
name: Deploy
11-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-latest
1215
steps:
1316
- name: Checkout the source code
1417
uses: actions/checkout@v4

0 commit comments

Comments
 (0)