-
Notifications
You must be signed in to change notification settings - Fork 17
160 lines (136 loc) · 4.27 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: PR
on:
pull_request:
branches: [ main ]
permissions:
id-token: write
contents: write
pull-requests: write
checks: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
persist-credentials: false
- name: "NPM Install, Build, and Cache"
id: npm-install-build-and-cache
uses: ./.github/actions/npm-install-build-and-cache
test:
name: Test
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
persist-credentials: false
- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build
- name: Test
run: npm run test-all
type-check:
name: Type Check
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
persist-credentials: false
- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build
- name: Type Check
run: npm run type-check-all
lint:
name: Lint
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
persist-credentials: false
- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build
- name: Lint
run: npm run lint-all
e2e-test:
name: End-to-end Test
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v4
with:
path: |
~/.cache
key: ${{ runner.os }}
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
persist-credentials: false
- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build
- name: End to End Test
run: npm run ci:e2e-tests
- name: Upload End to End Test Images
if: failure()
uses: actions/upload-artifact@v4
with:
name: images
path: e2e-tests/test/__image_snapshots__/
publish-gh-pages:
name: Publish GitHub Pages
needs: [ build ]
runs-on: ubuntu-latest
env:
PR_PATH: pull/${{github.event.number}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
persist-credentials: false
- name: "Retrieve Dependencies and Build Artifacts"
id: retrieve-deps-and-build
uses: ./.github/actions/retrieve-deps-and-build
- name: Set base URL for preview if PR
run: echo "BASE_URL=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ env.PR_PATH }}/" >> $GITHUB_ENV
- name: Deploy to PR preview
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./github-pages-publisher/build
destination_dir: ${{ env.PR_PATH }}
- name: Add PR Preview comment
uses: hasura/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
number: ${{ github.event.number }}
id: deploy-preview
message: "A preview of this PR can be seen here:\n\n ✨ ${{ env.BASE_URL }} ✨\n\nChanges may take a few minutes to propagate. The source is here: https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}/"
summary:
name: Summary
needs: [build, test, type-check, lint, e2e-test]
runs-on: ubuntu-latest
steps:
- name: Summary
run: |
echo "Build: ${{ needs.build.result }}"
echo "Test: ${{ needs.test.result }}"
echo "Type Check: ${{ needs.type-check.result }}"
echo "Lint: ${{ needs.lint.result }}"
echo "End-to-end Test: ${{ needs.e2e-test.result }}"