Skip to content

build: add nix support #80

build: add nix support

build: add nix support #80

name: Basic CI tests
# These tests run whenever source code changes. It checks whether the
# code is formatted, linted, passes tests, and can be built.
on:
workflow_dispatch:
push:
branches: [main, master, release, development]
paths: [browser/**, test/**, lib/**, src/**, package*, tsconfig*, vitest*, eslint*, prettier* ]
pull_request:
branches: [main, master, release, development]
types: [opened, synchronize, reopened]
paths: [browser/**, test/**, lib/**, src/**, package*, tsconfig*, vitest*, eslint*, prettier* ]
jobs:
basic-ci-matrix:
name: checking "npm run ${{ matrix.task }}" on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Install Nix using cachix
uses: cachix/[email protected]
- name: Set up Node.js using nix
run: nix profile install .#nodejs
- name: Install all dependencies
run: npm ci
- name: Run task (npm run ${{ matrix.task }})
run: npm run ${{ matrix.task }}
- name: Basic Functionality
if: ${{ matrix.task == 'build' }}
run: npm run start -- --help
- name: Upload build artifacts
if: ${{ matrix.task == 'build' }}
uses: actions/[email protected]
with:
retention-days: 7
name: dist-${{ github.sha }}-${{ matrix.os }}
path: dist
strategy:
fail-fast: true
matrix:
include:
# Linux-only tasks
- os: ubuntu-latest
task: "lint:check"
- os: ubuntu-latest
task: "format:check"
# Build on all OSes
- os: ubuntu-latest
task: build
- os: windows-latest
task: build
- os: macos-latest
task: build
# Tests on all OSes
- os: ubuntu-latest
task: test
- os: windows-latest
task: test
- os: macos-latest
task: test