-
Notifications
You must be signed in to change notification settings - Fork 323
104 lines (92 loc) · 3.03 KB
/
gui-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
# This file is not auto-generated. Feel free to edit it.
name: ✨ GUI
on:
push:
branches:
- develop
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-gui-pull-request
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
permissions:
contents: read # Read-only access to repository contents
issues: write # Write access to issues
pull-requests: write # Write access to pull requests
statuses: write # Write access to commit statuses
checks: write
jobs:
gui-changed-files:
name: 🔍 Files Changed
uses: ./.github/workflows/gui-changed-files.yml
secrets: inherit
prettier:
name: 🧹 Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 📦 Setup pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
name: ⎔ Setup Node
with:
node-version-file: .node-version
cache: "pnpm"
- if: startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')
name: Installing wasm-pack
uses: jetli/[email protected]
with:
version: v0.12.1
- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- uses: actions/cache/restore@v4
name: Download cache
id: cache
with:
path: |
node_modules/.cache/prettier
key: ${{ runner.os }}-gui-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gui
- name: Run prettier
run: pnpm run ci:prettier
- name: 💾 Save cache
uses: actions/cache/save@v4
if: always() && steps.cache.outputs.cache-hit != 'true'
id: save-cache
with:
key: ${{ steps.cache.outputs.cache-primary-key }}
path: |
node_modules/.cache/prettier
gui-checks:
name: 🧰 Checks
uses: ./.github/workflows/gui-checks.yml
needs: [gui-changed-files]
if: needs.gui-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop'
secrets: inherit
storybook:
name: 📚 Deploy Storybook
uses: ./.github/workflows/storybook.yml
needs: [gui-changed-files]
if: needs.gui-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop'
secrets: inherit
required-checks:
name: GUI Required Checks
runs-on: ubuntu-latest
needs: [prettier, gui-checks, storybook]
if: always()
steps:
- name: Checks Summary
run: |
echo "Prettier: ${{ needs.prettier.result }}"
echo "GUI Checks: ${{ needs.gui-checks.result }}"
echo "Storybook: ${{ needs.storybook.result }}"
declare -a checks
checks+=("${{ needs.prettier.result }}")
checks+=("${{ needs.gui-checks.result }}")
checks+=("${{ needs.storybook.result }}")
for result in "${checks[@]}"; do
if [[ "$result" == "failure" ]]; then
exit 1
fi
done
echo "Success!"