refactor workflows to use mise #64
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: Node.js CI | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
jobs: | ||
lint: | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- name: Checkout from GitHub repository | ||
uses: actions/checkout@v4 | ||
- name: Init environment with mise | ||
uses: jdx/mise-action@v2 | ||
with: | ||
experimental: true | ||
- name: Install node modules | ||
run: npm ci | ||
- name: Run lint | ||
run: npm run lint | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
node-version: [16.x, 18.x, 20.x] | ||
os: [ubuntu-22.04, windows-latest, macos-latest] | ||
exclude: | ||
- os: windows-latest | ||
node-version: 16.x | ||
- os: windows-latest | ||
node-version: 18.x | ||
- os: macos-latest | ||
node-version: 16.x | ||
- os: macos-latest | ||
node-version: 18.x | ||
steps: | ||
- name: Checkout from GitHub repository | ||
uses: actions/checkout@v4 | ||
- name: Init environment with mise (node version:: ${{ matrix.node-version }}) | ||
uses: jdx/mise-action@v2 | ||
with: | ||
experimental: true | ||
mise_toml: | | ||
[tools] | ||
node = "${{ matrix.node-version }}" | ||
- name: Install node modules | ||
run: npm ci | ||
- name: Build and Statically Render | ||
run: npm run predeploy | ||
env: | ||
NODE_ENV: development | ||
REACT_APP_ENVIRONMENT: development | ||
- name: Run tests | ||
run: npm test | ||
env: | ||
NODE_ENV: development | ||
REACT_APP_ENVIRONMENT: development |