Skip to content

Commit

Permalink
ci: add test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalexiei committed Sep 8, 2024
1 parent 5e7ec93 commit c7184d9
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/actions/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Setup Node and PNPM"

runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
42 changes: 42 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

concurrency:
group: "${{ github.workflow }} - ${{ github.head_ref || github.ref }}"
cancel-in-progress: true

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Test (Node ${{ matrix.node }})
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
node: [18, 20, 22]

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

- name: Setup PNPM
uses: ./.github/actions/setup-pnpm

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Run test
run: pnpm run test

0 comments on commit c7184d9

Please sign in to comment.