Skip to content

Commit

Permalink
Make tests run on other OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
illright committed Jun 16, 2024
1 parent d6d1d35 commit b3354de
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
27 changes: 27 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Setup and install"
description: "Common setup steps for Actions"
inputs:
node-version:
description: "Version of Node.js"
required: true
default: "20"

runs:
using: composite
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: "pnpm"

- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
shell: bash
run: pnpm install
41 changes: 23 additions & 18 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@ on:
push:

jobs:
check-code-quality:
static-checks:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"

- name: Install dependencies
run: pnpm install
- name: Setup
uses: ./.github/actions/setup

- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test
- run: pnpx prettier --check .

check-code-quality:
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [18, 22]

steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node }}

- name: Run tests
run: pnpm test

- name: Try building the library
run: pnpm build

0 comments on commit b3354de

Please sign in to comment.