fork/team

git clone https://git.julia.blue/fork/team

Marco IeniMerge pull request #1681 from Kobzol/dry-run-extcde5a40

remove-fuchsia
2.4 KiB79 linesraw
1name: CI
2
3on: [ push, pull_request ]
4
5jobs:
6  ci:
7    name: CI
8    runs-on: ubuntu-latest
9    if: github.repository == 'rust-lang/team'
10    permissions:
11      id-token: write
12    steps:
13
14      - uses: actions/checkout@main
15        with:
16          fetch-depth: 50
17
18      - name: Install Rust Stable
19        run: |
20          rustc -vV
21          rustup update stable
22          rustup default stable
23          rustc -vV
24
25      - uses: Swatinem/rust-cache@v2
26
27      - name: Build the validation tool
28        run: cargo build
29
30      - name: Validate the repository contents
31        run: cargo run -- check --strict
32        env:
33          GITHUB_TOKEN: ${{ secrets.github_token }}
34
35      - name: Run rustfmt
36        run: cargo fmt -- --check
37
38      - name: Run tests
39        run: cargo test --workspace --all-features
40
41      - name: Build the contents of the static API
42        run: |
43          cargo run -- static-api build
44          echo "team-api.infra.rust-lang.org" > build/CNAME
45
46      - name: Write PR number into the uploaded archive
47        if: ${{ github.event_name == 'pull_request' }}
48        run: echo "${{ github.event.pull_request.number }}" > build/pr.txt
49
50      - name: Upload the built JSON as a GitHub artifact
51        if: ${{ github.event_name == 'pull_request' }}
52        uses: actions/upload-artifact@v4
53        with:
54          name: team-api-output
55          path: build
56
57      - name: Deploy to GitHub Pages
58        run: |
59          touch build/.nojekyll
60          curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy
61          (cd build && /tmp/deploy)
62        env:
63          GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }}
64        if: github.event_name == 'push' && github.ref == 'refs/heads/master'
65
66      - name: Configure AWS credentials
67        if: github.event_name == 'push' && github.ref == 'refs/heads/master'
68        uses: aws-actions/configure-aws-credentials@v1
69        with:
70          role-to-assume: arn:aws:iam::890664054962:role/ci--rust-lang--team
71          aws-region: us-west-1
72
73      - name: Start the synchronization tool
74        if: github.event_name == 'push' && github.ref == 'refs/heads/master'
75        run: |
76          # Introduce some artificial delay to help github pages propagate.
77          sleep 60
78          aws --region us-west-1 lambda invoke --function-name start-sync-team output.json
79          cat output.json | python3 -m json.tool