-
-
Notifications
You must be signed in to change notification settings - Fork 271
63 lines (61 loc) · 1.73 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CI
on:
push:
branches: [master]
paths:
- .github/workflows/main.yml
- packages/**/*.{js,ts,json}
- '*.{json,js}'
- .eslintrc
- tools/**/*
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 16 # 2023-09-11
- 18 # 2025-04-30
- latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.sha }}
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 8.4.0
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
env:
cache-name: casl-deps
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: pnpm install
- name: Get base sha
id: base-commit
run: |
echo "sha=${{ github.event.pull_request.base.sha || github.event.before }}" >> $GITHUB_OUTPUT
- name: Build
run: pnpm run -r --filter '[${{ steps.base-commit.outputs.sha }}]...' build
- name: lint
run: pnpm run -r --filter '[${{ steps.base-commit.outputs.sha }}]' lint
- name: test
run: pnpm run -r --filter '...[${{ steps.base-commit.outputs.sha }}]' test --coverage
- name: submit coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: pnpm run coverage.submit