Skip to content

feat: react support #15

feat: react support

feat: react support #15

Workflow file for this run

name: 'Build & Test'
on:
push:
branches:
- master
- release/**
pull_request:
jobs:
job_build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.15.5
run_install: false
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'pnpm'
- name: Install dependencies with pnpm
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Pack
run: pnpm pack
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
path: |
${{ github.workspace }}/*.tgz
job_lint:
name: Lint
needs: job_build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.15.5
run_install: false
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'pnpm'
- name: Install dependencies with pnpm
run: pnpm install --frozen-lockfile
- name: Run Linter
run: pnpm lint
job_test:
name: Node (${{ matrix.node }}) Unit Tests
needs: job_build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.15.5
run_install: false
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: Install dependencies with pnpm
run: pnpm install --frozen-lockfile
- name: Run Unit Tests
run: pnpm test
- name: Push code coverage to codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # [email protected]
with:
# Need to specify the token here, as the codecov action requires it for protected branches.
# If not set, this error is shown: `Token required because branch is protected`
token: ${{ secrets.CODECOV_TOKEN }}
# Do not fail the build if codecov fails to report the coverage.
fail_ci_if_error: false
flags: unit-tests