59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
name: build-and-test
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- develop
|
|
env:
|
|
PNPM_CACHE_FOLDER: .pnpm-store
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
node: [18]
|
|
|
|
steps:
|
|
- name: Checkout 🛎
|
|
uses: actions/checkout@master
|
|
|
|
- name: Setup node env 🏗
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
check-latest: true
|
|
|
|
- uses: pnpm/action-setup@v2.2.2
|
|
name: Install pnpm
|
|
with:
|
|
version: 7
|
|
run_install: false
|
|
|
|
- name: Setup pnpm config 🏗
|
|
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
|
|
|
|
- name: Install dependencies 👨🏻💻
|
|
run: pnpm install
|
|
|
|
- name: Turbo Cache
|
|
id: turbo-cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: .turbo
|
|
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
|
|
restore-keys: |
|
|
turbo-${{ github.job }}-${{ github.ref_name }}-
|
|
|
|
- name: Run linter 🧹
|
|
run: pnpm run lint --cache-dir=.turbo
|
|
|
|
- name: Build Library 👷
|
|
run: pnpm run build --cache-dir=.turbo
|
|
|
|
- name: Run tests 🧪
|
|
run: pnpm run test --cache-dir=.turbo
|