This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
generated from tophat/new-project-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (113 loc) · 3.38 KB
/
pull-request.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Continuous Integration
on:
push:
branches:
- master
pull_request:
env:
CI: 1
ARTIFACT_DIR: ./artifacts
jobs:
linting:
name: Lint
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Create artifacts directory
run: mkdir -p ${{ env.ARTIFACT_DIR }}
- name: Restore yarn cache
id: yarn-cache
uses: actions/cache@v2
with:
path: |
./.yarn
./.pnp.*
key: ${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable
- name: Linting
run: yarn lint:ci
- name: Typecheck
run: yarn types
tests:
name: Tests
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Create artifacts directory
run: mkdir -p ${{ env.ARTIFACT_DIR }}
- name: Restore yarn cache
id: yarn-cache
uses: actions/cache@v2
with:
path: |
./.yarn
./.pnp.*
key: ${{ matrix.node-version }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable
- name: Set GitHub user for tests
run: |
git config --global user.email "[email protected]"
git config --global user.name "Top Hat Open Source"
- name: Tests
run: yarn test:ci
- name: Upload Coverage Report
run: ./.github/codecov.sh $GITHUB_EVENT_PATH
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: report-artifacts
path: ${{ env.ARTIFACT_DIR }}
build:
name: Build
runs-on: ubuntu-latest
needs: [linting,tests]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/detect-env
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Create artifacts directory
run: mkdir -p ${{ env.ARTIFACT_DIR }}
- name: Restore yarn cache
id: yarn-cache
uses: actions/cache@v2
with:
path: |
./.yarn
./.pnp.*
key: ${{ env.NODE_VERSION }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn build
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: ${{ env.ARTIFACT_DIR }}