Merge pull request #16 from Applelo/dev #65
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node_version: [14, 16, 18, 20] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
# Active LTS + other OS | |
- os: macos-latest | |
node_version: 18 | |
- os: windows-latest | |
node_version: 18 | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm (node 14, pnpm 7) | |
if: matrix.node_version == 14 | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 7 | |
- name: Install pnpm (node 16, pnpm 8) | |
if: matrix.node_version == 16 | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Install pnpm | |
if: matrix.node_version > 16 | |
uses: pnpm/action-setup@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: pnpm | |
- name: Install | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Test | |
run: pnpm test | |
coverage: | |
runs-on: ubuntu-latest | |
name: Coverage | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
- name: Set node version to 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Test | |
run: pnpm coverage | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
lint: | |
runs-on: ubuntu-latest | |
name: 'Lint: node-20, ubuntu-latest' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
- name: Set node version to 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Lint | |
run: pnpm lint | |
- name: Typecheck | |
run: pnpm typecheck |