Skip to content

Add Github Actions Integration #1

Add Github Actions Integration

Add Github Actions Integration #1

Workflow file for this run

name: Build and Test
on:
workflow_dispatch:
push:
branches: [ main, beta ]
pull_request:
branches: [ main, beta ]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
NODE_VERSION: 18
CACHE_KEY: '${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}'
jobs:
build:
strategy:
matrix:
node: [ 16, 18, 20 ]
name: Build Package (Node ${{ matrix.node }})
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm ci --include=dev
- name: Build package
run: npm run build
- name: Lint
run: npm run lint && npm run lint:package
- name: Run Tests against browser
run: npm run test:browser
- name: Run Tests against node
run: npm run test:node
- name: Save build artifacts
uses: actions/cache/save@v3
with:
path: .
key: ${{ env.CACHE_KEY }}