-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 1.67 KB
/
Copy pathweekly.yml
File metadata and controls
63 lines (56 loc) · 1.67 KB
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
name: Weekly Quality Check
on:
schedule:
- cron: '0 9 * * 1'
workflow_dispatch:
jobs:
quality:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- name: Prepare pnpm
if: hashFiles('pnpm-lock.yaml') != ''
run: |
corepack enable
if node -e "const pm=require('./package.json').packageManager||''; process.exit(pm.startsWith('pnpm@')?0:1)"; then
corepack install
else
corepack prepare pnpm@10.32.1 --activate
fi
- name: Install dependencies
run: |
if [ -f pnpm-lock.yaml ]; then
pnpm install --frozen-lockfile --ignore-scripts
elif [ -f package-lock.json ]; then
npm ci --ignore-scripts
elif [ -f yarn.lock ]; then
corepack enable
yarn install --immutable
else
npm install --ignore-scripts
fi
- name: Run available quality scripts
run: |
run_script() {
local script="$1"
if node -e "const s=require('./package.json').scripts||{}; process.exit(s[process.argv[1]]?0:1)" "$script"; then
if [ -f pnpm-lock.yaml ]; then
pnpm run "$script"
elif [ -f yarn.lock ]; then
yarn "$script"
else
npm run "$script"
fi
else
echo "No $script script"
fi
}
run_script lint
run_script typecheck
run_script test
run_script build