name: CI on: [ push, pull_request ] jobs: ci: name: CI runs-on: ubuntu-latest if: github.repository == 'rust-lang/team' permissions: id-token: write steps: - uses: actions/checkout@main with: fetch-depth: 50 - name: Install Rust Stable run: | rustc -vV rustup update stable rustup default stable rustc -vV - uses: Swatinem/rust-cache@v2 - name: Build the validation tool run: cargo build - name: Validate the repository contents run: cargo run -- check --strict env: GITHUB_TOKEN: ${{ secrets.github_token }} - name: Run rustfmt run: cargo fmt -- --check - name: Run tests run: cargo test --workspace --all-features - name: Build the contents of the static API run: | cargo run -- static-api build echo "team-api.infra.rust-lang.org" > build/CNAME - name: Write PR number into the uploaded archive if: ${{ github.event_name == 'pull_request' }} run: echo "${{ github.event.pull_request.number }}" > build/pr.txt - name: Upload the built JSON as a GitHub artifact if: ${{ github.event_name == 'pull_request' }} uses: actions/upload-artifact@v4 with: name: team-api-output path: build - name: Deploy to GitHub Pages run: | touch build/.nojekyll curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy (cd build && /tmp/deploy) env: GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }} if: github.event_name == 'push' && github.ref == 'refs/heads/master' - name: Configure AWS credentials if: github.event_name == 'push' && github.ref == 'refs/heads/master' uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: arn:aws:iam::890664054962:role/ci--rust-lang--team aws-region: us-west-1 - name: Start the synchronization tool if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: | # Introduce some artificial delay to help github pages propagate. sleep 60 aws --region us-west-1 lambda invoke --function-name start-sync-team output.json cat output.json | python3 -m json.tool