-
Notifications
You must be signed in to change notification settings - Fork 25
102 lines (90 loc) · 2.75 KB
/
pr.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
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
name: "PR Checks"
on:
pull_request:
types: [opened, synchronize, edited, closed]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
COVERAGE_FILE: ./coverage/report.json
jobs:
validate-title:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check-packages-changed:
name: Assign project changed
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.packages-changed.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
- name: Check external packages changes
id: packages-changed
uses: tj-actions/changed-files@v22.2
with:
files: |
**/packages/**
changesets:
name: Changeset Checks
needs: check-packages-changed
if: ${{ github.head_ref != 'changeset-release/main' && needs.check-packages-changed.outputs.changed == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# need this to get full git-history/clone in order to build changelogs and check changesets
fetch-depth: 0
- uses: FuelLabs/github-actions/setups/node@master
with:
pnpm-version: 8.15.7
- run: pnpm changeset:check
audit:
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: FuelLabs/github-actions/setups/node@master
with:
pnpm-version: 8.15.7
- run: pnpm audit --prod
lint-build:
name: Lint & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: FuelLabs/github-actions/setups/node@master
with:
pnpm-version: 8.15.7
- run: |
pnpm lint
pnpm build
test:
name: Tests with coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: FuelLabs/github-actions/setups/node@master
with:
pnpm-version: 8.15.7
- name: Checking PR Number
uses: jwalton/gh-find-current-pr@v1
id: findPr
- name: Run Jest Tests
run: |
pnpm test:ci --outputFile="${{ env.COVERAGE_FILE }}"
- name: Publish coverage
uses: artiomtr/jest-coverage-report-action@v2.0.5
if: ${{ steps.findPr.outputs.number }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
package-manager: pnpm
annotations: failed-tests
test-script: pnpm test:ci
prnumber: ${{ steps.findPr.outputs.number }}
skip-test: all
coverage-file: ${{ env.COVERAGE_FILE }}
base-coverage-file: ${{ env.COVERAGE_FILE }}