build(deps): bump the minor-and-patch group across 1 directory with 40 updates #41
Workflow file for this run
This file contains 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: Test Workflow | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, reopened, synchronize] # default PR types | |
branches: [main, next] | |
paths: ["src/**/*", "package*.json"] | |
push: | |
branches: [main, next] | |
paths: ["src/**/*", "package*.json"] | |
jobs: | |
test: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # to checkout the code | |
pull-requests: write # to add coverage reports to the PR | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Run Tests | |
id: run-tests | |
run: | | |
npm ci --include=dev | |
npm run test:ci | |
- name: Update GitHub Commit Status | |
if: ${{ !cancelled() }} | |
run: | | |
if [ ${{ steps.run-tests.outcome }} == 'success' ]; then | |
commit_status_state='success' | |
description='Tests passed' | |
else | |
commit_status_state='failure' | |
description='Tests failed' | |
fi | |
curl --request POST \ | |
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
--header 'content-type: application/json' \ | |
--data "{ | |
\"context\": \"tests\", | |
\"state\": \"$commit_status_state\", | |
\"description\": \"$description\", | |
\"target_url\": \"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\" | |
}" | |
- name: Update CodeCov | |
if: success() | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Update PR with Coverage Reports | |
if: github.event_name == 'pull_request' | |
uses: davelosert/vitest-coverage-report-action@v2 | |
release: | |
name: Release if Tests Passed (on push/dispatch only) | |
needs: test # only run on push/dispatch events when tests pass | |
if: github.event_name != 'pull_request' && needs.test.result == 'success' | |
uses: ./.github/workflows/release.yaml | |
secrets: | |
SEMANTIC_RELEASE_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} |