chore(release): 16.2.0 #1429
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 / test | |
| on: | |
| pull_request: | |
| branches: ['**'] | |
| pull_request_target: | |
| branches: ['**'] | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| checks: write | |
| statuses: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # For pull_request_target, checkout the PR branch | |
| ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }} | |
| - name: Install jq | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| - name: Install yq | |
| uses: mikefarah/yq@v4.40.1 | |
| - name: Setup Bats and bats libs | |
| id: setup-bats | |
| uses: bats-core/bats-action@6709b66533837d44e32f014ef4152e31e0047a17 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| - name: Run all tests | |
| id: run_tests | |
| shell: bash | |
| env: | |
| BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }} | |
| TERM: xterm | |
| run: bash tests/run-all-tests.sh | |
| # Create a GitHub status for branch protection | |
| - name: Report status | |
| if: always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const state = '${{ steps.run_tests.outcome }}' === 'success' ? 'success' : 'failure'; | |
| // For pull_request_target, use the PR head SHA instead of context.sha | |
| const sha = context.eventName === 'pull_request_target' | |
| ? context.payload.pull_request.head.sha | |
| : context.sha; | |
| console.log(`Creating status for SHA: ${sha}`); | |
| await github.rest.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: sha, | |
| state: state, | |
| context: 'CI / test', | |
| description: 'Tests completed', | |
| target_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
| }); |