-
Notifications
You must be signed in to change notification settings - Fork 24
73 lines (59 loc) · 1.88 KB
/
pr-check.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
64
65
66
67
68
69
70
71
72
73
name: pr-check
on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'
jobs:
Check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [21.x, 20.x, 18.x, 16.x]
steps:
- name: Begin Check...
uses: actions/checkout@v2
- name: Use NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: 🐛 Linter 🕵️
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '15.x'
run: npm run linter
- name: 🐛 Test on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: xvfb-run npm run test:coverage
- name: 🐛 Test on other os
if: matrix.os != 'ubuntu-latest'
run: npm test
- name: publish code coverage on CodeClimate
if: matrix.os == 'ubuntu-latest'
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 7224dfa80ac316eaffa0c0d753c472d455d995ac1a10dd2ff66462ad48b70577
- name: publish code coverage on Coveralls
if: matrix.os == 'ubuntu-latest'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}