This repository was archived by the owner on Mar 31, 2025. It is now read-only.
explain new repository location #615
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
merge_group: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build | |
- name: Run tests | |
run: cargo test | |
- name: Run rustfmt | |
run: cargo fmt -- --check | |
- name: Run clippy | |
run: cargo clippy -- -Dwarnings | |
deploy: | |
name: Deploy | |
needs: [ test ] | |
environment: deploy | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
if: github.event_name == 'merge_group' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker container | |
run: docker build -t sync-team . | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::890664054962:role/ci--rust-lang--sync-team | |
aws-region: us-west-1 | |
- name: Login to Amazon ECR Private | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push docker image to Amazon ECR | |
env: | |
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
REPOSITORY: sync-team | |
run: | | |
docker tag sync-team $REGISTRY/$REPOSITORY:latest | |
docker push $REGISTRY/$REPOSITORY:latest | |
- name: Start the synchronization tool | |
run: | | |
aws --region us-west-1 lambda invoke --function-name start-sync-team output.json | |
cat output.json | python3 -m json.tool | |
# Summary job for the merge queue. | |
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! | |
conclusion: | |
name: CI | |
needs: [ test, deploy ] | |
# 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" or .result == "skipped")' <<< '${{ toJson(needs) }}' |