-
Notifications
You must be signed in to change notification settings - Fork 5
76 lines (64 loc) · 2.02 KB
/
test-lint.yaml
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
74
75
76
name: Test
on:
push:
branches:
- '**' # This makes the workflow only runs by push to branch, not pushed git tag
paths-ignore:
- '.devbots/**'
- '.husky/**'
- '.vscode/**'
- .editorconfig
- commitlint.config.js
- license
- docs/urls.json
pull_request:
paths-ignore:
- '.devbots/**'
- '.husky/**'
- '.vscode/**'
- .editorconfig
- commitlint.config.js
- license
- docs/urls.json
jobs:
# [original source of job "check-if-to-skip"](https://github.com/srz-zumix/ci-skip/blob/master/.github/workflows/main.yml#L15)
skip:
runs-on: ubuntu-latest
# skip commits with [ci skip] or [skip ci], except on an action triggered by push of a version tag
if: "!( contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]') )"
steps:
- name: Check [ci skip] or [skip ci]
run: exit 0
test:
needs: skip
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# 0 indicates all history for all branches and tags.
fetch-depth: 0 # For git history test
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8.10.2
run_install: false # For cache
- name: Read .nvmrc
id: nvmrc
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
# pnpm should be installed before the setup-node action. REF: https://github.com/actions/setup-node/issues/530
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvmrc.outputs.version }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test and measure coverage
run: pnpm turbo test -- --ci
- uses: codecov/codecov-action@v3
- name: Lint
run: pnpm turbo lint:ci
- name: Lint markdown
run: pnpm turbo lint:md:ci