-
Notifications
You must be signed in to change notification settings - Fork 10
54 lines (51 loc) · 1.65 KB
/
pr.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
name: PR
on:
pull_request:
types: [opened, synchronize, reopened, closed]
# cancel previous runs when the PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pr:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' }}
steps:
- name: Checkout all commits
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
with:
node_version: 20.10.0
- name: Commit lint
shell: bash
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
- name: Lint TypeScript
shell: bash
run: npx nx affected --target=lint --parallel=5
- name: Lint Go
uses: golangci/golangci-lint-action@v3
with:
skip-cache: true
- name: Compile
shell: bash
run: npx nx affected --target=compile --parallel=5
- name: Test
shell: bash
run: npx nx affected --target=test --parallel=5
- name: Test Go
uses: n8maninger/action-golang-test@v1
with:
args: '-race'
- name: Build
shell: bash
run: npx nx affected --target=build --configuration=production --parallel=5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
- name: Export
shell: bash
# issue with parallelism
run: npx nx affected --target=build --configuration=export --parallel=5