Remove commented constructor keys in example (#207) #96
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 | |
env: | |
# @TODO We should really remove this, but at the time of writing even | |
# a completely new yarn.lock currently breaks the build with a: | |
# The lockfile would have been modified by this install, which is explicitly forbidden. | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
eslint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- run: corepack yarn | |
- run: corepack yarn eslint . | |
pack: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- run: corepack yarn | |
- run: corepack yarn pack | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: package | |
path: '*.tgz' | |
prettier: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- run: corepack yarn | |
- run: corepack yarn prettier --check . | |
typescript: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- run: corepack yarn | |
- run: corepack yarn tsc --build | |
vitest: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: | |
- 18 | |
- 20 | |
- 22 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- run: corepack yarn | |
- run: corepack yarn vitest run --coverage ./test/unit | |
- name: Upload coverage reports artifact | |
if: matrix.node == 22 # Only upload coverage from the latest Node.js version | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-reports | |
path: coverage/ | |
coverage: | |
needs: vitest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: coverage-reports | |
path: coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage/lcov.info | |
flags: unittests | |
name: node-sdk | |
fail_ci_if_error: true | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- eslint | |
- pack | |
- prettier | |
- typescript | |
- vitest | |
- coverage | |
if: startsWith(github.ref, 'refs/tags/') | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: https://registry.npmjs.org | |
- uses: actions/download-artifact@v4 | |
with: { name: package } | |
- run: npm publish *.tgz --provenance | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |