Skip to content

feat: Update Node version and ci actions #141

feat: Update Node version and ci actions

feat: Update Node version and ci actions #141

Workflow file for this run

on:
push:
branches:
- main
pull_request:
branches:
- main
name: Push or PR
jobs:
test:
name: Build, Test and maybe Publish
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ matrix.node-version }}-${{ runner.OS }}-npm-${{ hashFiles('package-lock.json') }}
- name: Install deps
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: ESLint
run: npm run test:lint
- name: Type checking
run: npm run test:typecheck
- name: Building packages
run: npm run build
- name: Unit testing (with GC)
run: npm run test:unit:gc
- name: Create Release Pull Request or Publish to npm
id: changesets
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: changesets/action@v1
with:
version: npx changeset version
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Send a notification if a publish happens
if: steps.changesets.outputs.published == 'true'
# You can do something when a publish happens.
run: echo "A new version of ${GITHUB_REPOSITORY} was published!"