-
-
Notifications
You must be signed in to change notification settings - Fork 16
108 lines (102 loc) · 2.71 KB
/
nightly.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
name: Nightly Checks
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
schedule:
# Run checks nightly at midnight
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
prepare:
name: Prepare Targets
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
examples: ${{ steps.targets.outputs.examples }}
templates: ${{ steps.targets.outputs.templates }}
steps:
- uses: actions/checkout@v4
- name: Find all build targets
id: targets
run: |
examples=$(
find templates -mindepth 1 -maxdepth 1 -type d |
jq -cnR '[inputs | select(length > 0)]'
)
templates=$(
find templates -mindepth 1 -maxdepth 1 -type d |
jq -cnR '[inputs | select(length > 0)]'
)
echo "examples=${examples}" >> $GITHUB_OUTPUT
echo "templates=${templates}" >> $GITHUB_OUTPUT
examples:
name: Check Examples
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [prepare]
strategy:
matrix:
example: ${{ fromJSON(needs.prepare.outputs.examples) }}
fail-fast: true
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: ${{ matrix.example }}
sparse-checkout-cone-mode: false
- name: Move files to root
run: |
ls -lah
shopt -s dotglob
mv ${{ matrix.example }}/* .
rm -rf examples
ls -lah
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 20.14.0
- name: Install dependencies
run: pnpm install
- run: pnpm lint
- run: pnpm check
- run: pnpm test
templates:
name: Check Templates
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [prepare]
strategy:
matrix:
template: ${{ fromJSON(needs.prepare.outputs.templates) }}
fail-fast: true
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: ${{ matrix.template }}
sparse-checkout-cone-mode: false
- name: Move files to root
run: |
ls -lah
shopt -s dotglob
mv ${{ matrix.template }}/* .
rm -rf templates
ls -lah
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 20.14.0
- name: Install dependencies
run: pnpm install
- run: pnpm lint
- run: pnpm check
- run: pnpm build
- run: pnpm test