Skip to content

fix: esm imports

fix: esm imports #218

Workflow file for this run

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 docs to Pages
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 Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4