test(backend): run integration tests with nextest across parallel CI shards #10580
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: Formatting Backend and Scripts | |
| on: | |
| pull_request: | |
| paths: | |
| - # Files formatted by ./scripts/format.cargo.sh | |
| '**/Cargo.toml' | |
| - # Files formatted by ./scripts/format.rust.sh | |
| '**/*.rs' | |
| - # Files formatted by ./scripts/format.sh.sh | |
| # Note: shell scripts not ending in .sh are found with: scripts/format.sh.sh --list | grep -vE 'sh$' | |
| '**/*.sh' | |
| - 'docker/*' | |
| - 'scripts/*' | |
| - # This workflow | |
| '.github/workflows/formatting-checks.yml' | |
| - # Rust format configuration | |
| 'rustfmt.toml' | |
| merge_group: | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| format: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: Create GitHub App Token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| continue-on-error: true | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }} | |
| private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }} | |
| - name: Check if commits can be added | |
| id: check_can_add_commit | |
| run: | | |
| echo "can_add_commit=$CAN_ADD_COMMIT" >> $GITHUB_OUTPUT | |
| env: | |
| CAN_ADD_COMMIT: ${{ steps.app-token.outputs.token != '' && github.event_name == 'pull_request' }} | |
| - name: Checkout code | |
| if: steps.check_can_add_commit.outputs.can_add_commit == 'true' | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| token: ${{ steps.app-token.outputs.token }} | |
| persist-credentials: false | |
| - name: Checkout code | |
| if: steps.check_can_add_commit.outputs.can_add_commit == 'false' | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install rust | |
| run: scripts/setup rust | |
| - name: Install shfmt | |
| run: scripts/setup shfmt | |
| - name: Install binstall | |
| run: scripts/setup cargo-binstall | |
| - name: Install cargo dependency sorter | |
| run: cargo binstall --no-confirm cargo-sort@1.0.9 | |
| - name: Format | |
| run: ./scripts/format.sh | |
| - name: Check formatted | |
| id: check_changes | |
| run: | | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| echo "changes_detected=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changes_detected=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit format | |
| if: steps.check_can_add_commit.outputs.can_add_commit == 'true' && steps.check_changes.outputs.changes_detected == 'true' | |
| uses: ./.github/actions/add-and-commit | |
| with: | |
| message: '🤖 Apply formatting changes' | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Provide diff | |
| if: steps.check_can_add_commit.outputs.can_add_commit == 'false' && steps.check_changes.outputs.changes_detected == 'true' | |
| run: | | |
| echo "FIX: Please run ./scripts/format.sh" | |
| git diff | |
| exit 1 |