build(deps-dev): bump the npm-dev-dependencies group with 4 updates #269
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 and Build | |
on: | |
push: | |
branches: [ latest ] | |
pull_request: | |
branches: [ latest ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build (Node.js v${{ matrix.node-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: | |
- 18 | |
- 20 | |
- 21 | |
- 22 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
fetch-tags: false | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }}.x | |
- name: Install dependencies | |
run: npm install | |
- name: Run Build | |
run: npm run build | |
- name: Audit, fix outdated dependencies and rebuild | |
run: | | |
npm list --outdated | |
npm audit || true | |
npm audit fix || true | |
npm list --outdated | |
npm run build | |
test: | |
name: Test and report coverage | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
fetch-tags: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
- name: Install dependencies | |
run: npm install | |
- name: Run Lint | |
run: npm run lint | |
- name: Run Test | |
run: npm run test | |
- name: Codacy coverage report | |
uses: codacy/codacy-coverage-reporter-action@v1 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: ./coverage/lcov.info | |
trigger-release: | |
if: github.ref == 'refs/heads/latest' | |
name: Trigger Release on latest | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- name: Create semantic-release repository dispatch event | |
env: | |
GH_TOKEN: ${{ github.token }} | |
COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
run: | | |
gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/${{ github.repository }}/dispatches \ | |
-f "event_type=semantic-release" \ | |
-F "client_payload[commit_message]=$COMMIT_MESSAGE" | |
docs: | |
if: github.ref == 'refs/heads/latest' | |
name: Deploy documentation | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
fetch-tags: false | |
- name: Setup gh-pages | |
uses: actions/configure-pages@v5 | |
- name: Upload gh-pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: docs | |
path: './docs' | |
- name: Deploy gh-pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: docs | |
reporting_interval: 2000 | |
timeout: 180000 |