chore: test CI #1599
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: Build and test | |
on: [push, pull_request] | |
env: | |
CI: true | |
jobs: | |
build: | |
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node: [20] | |
os: [ubuntu-latest, macos-latest] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Use Node ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install pnpm | |
id: pnpm-install | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install Python dependencies on Ubuntu | |
if: runner.os == 'Linux' | |
run: sudo apt-get update && sudo apt-get install -y python3-distutils | |
- name: Install Python dependencies on macOS | |
if: runner.os == 'macos-latest' | |
run: | | |
brew install [email protected] | |
/opt/homebrew/bin/python3.9 -m venv venv | |
source venv/bin/activate | |
pip install distutils | |
- name: Install dependencies and build | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm run build --force | |
- name: Lint | |
run: pnpm run lint | |
- name: Test | |
run: pnpm run test:ci --force |