Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 50 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: CI
on:
push:
branches:
- master
pull_request: { }
merge_group:
pull_request:
schedule:
- cron: "0 12 * * 1" # Every Monday at 12:00 UTC

env:
AWS_ACCESS_KEY_ID: AKIA46X5W6CZBLO3VBND

jobs:
test_and_deploy:
test-linux:
name: Test and deploy
runs-on: ubuntu-22.04
env:
Expand Down Expand Up @@ -52,35 +50,12 @@ jobs:
- name: Formatting check
run: cargo fmt --all -- --check

- uses: docker/setup-buildx-action@v2
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
# Export the image to Docker to make it available in the next step
load: true
tags: rustc-perf
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Check licenses
run: |
pip install reuse==4.0.3
reuse lint

- name: Deploy to production
uses: rust-lang/simpleinfra/github-actions/upload-docker-image@master
with:
image: rustc-perf
repository: rust-rustc-perf
region: us-west-1
redeploy_ecs_cluster: rust-ecs-prod
redeploy_ecs_service: rustc-perf
aws_access_key_id: "${{ env.AWS_ACCESS_KEY_ID }}"
aws_secret_access_key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/deploy'

test_on_windows:
test-windows:
name: Test on Windows
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -110,7 +85,7 @@ jobs:
- name: Run unit tests
run: cargo test --all

test_benchmarks:
test-benchmarks:
strategy:
matrix:
# We split `bench_local` testing into four jobs that run in parallel,
Expand Down Expand Up @@ -170,7 +145,7 @@ jobs:
PROFILES: ${{ matrix.PROFILES }}
SHELL: "/bin/bash"

test_backends:
test-backends:
name: Test codegen backend benchmarks
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -206,7 +181,7 @@ jobs:
BACKENDS: Cranelift
SHELL: "/bin/bash"

test_runtime_benchmarks:
test-runtime-benchmarks:
name: Test runtime benchmarks
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -239,7 +214,7 @@ jobs:
env:
SHELL: "/bin/bash"

test_profiling:
test-profiling:
name: Test profiling
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -415,3 +390,45 @@ jobs:
run: |
DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres cargo run --bin site &
python3 ci/check-site.py version1 version2

docker:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
tags: rustc-perf
cache-from: type=gha
cache-to: type=gha,mode=max

# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
conclusion:
needs:
- test-linux
- test-windows
- test-benchmarks
- test-backends
- test-runtime-benchmarks
- test-profiling
- database-check
- site-endpoint
- docker
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Manual deploy
on:
push:
branches:
- master
workflow_dispatch:

env:
Expand All @@ -8,7 +11,7 @@ env:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
Expand Down
Loading