feat: support ecmascript syntax #475
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: CI | |
on: | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- .gitignore | |
- LICENSE | |
- README.md | |
- .github/dependabot.yml | |
- .github/workflows/deploy.yml | |
- .github/workflows/bump.yml | |
env: | |
node_version: "22.x" | |
jobs: | |
test: | |
name: Test Module | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x, 22.x] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: npm install | |
run: npm install | |
- name: npm test | |
run: npm run test | |
- name: npm test with coverage | |
if: ${{ matrix.node-version == env.node_version }} # just run coverage if node 16 | |
run: npm run coverage | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.node-version == env.node_version }} # just run coverage if node 16 | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
lint: | |
name: Lint Module | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
- name: npm install | |
run: npm install | |
- name: npm lint | |
run: npm run lint | |
# https://github.com/marketplace/actions/release-drafter | |
draft_release: | |
name: Draft Release | |
runs-on: ubuntu-latest | |
needs: [test, lint] | |
steps: | |
- uses: actions/checkout@v4 | |
- id: version | |
run: echo ::set-output name=version::$(node -p 'require("./package.json").version') | |
- name: Draft release | |
id: draft | |
uses: release-drafter/release-drafter@v6 | |
with: | |
version: ${{ steps.version.outputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Link to Release | |
run: | | |
echo "Release draft create/updated: ${{ steps.draft.outputs.html_url }}" | |
# ENH: maybe look into adding a comment to the PR with a link to the release draft? |