Skip to content

feat: support ecmascript syntax #476

feat: support ecmascript syntax

feat: support ecmascript syntax #476

Workflow file for this run

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]
node_index: [0, 1]
total_nodes: [2]
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 coverage
env:
CI_NODE_INDEX: ${{ matrix.node_index }}
CI_NODE_TOTAL: ${{ matrix.total_nodes }}
- 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?