Repository navigation
120 lines (92 loc) · 3.17 KB
/
Copy pathbuilder.yml
File metadata and controls
120 lines (92 loc) · 3.17 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
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
name: Quality Checks
on:
push:
branches:
- "main"
pull_request:
types: [opened, synchronize, reopened, review_requested, ready_for_review, draft]
permissions:
contents: read
jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Cache node modules
uses: actions/cache@v5
with:
path: node_modules
key: ${{ runner.os }}-bun-node-modules-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-node-modules-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Prepare config
run: bun run prepare:config
- name: Generate i18n files
run: bun run i18n
- name: Check ticket bans with an isolated database
run: bun run ticketban:test
- name: Run typecheck, biome, drizzle, and build checks
shell: bash
run: |
set +e
run_check() {
local name="$1"
shift
"$@" > "quality-${name}.txt" 2>&1
return $?
}
run_check typecheck bun run typecheck &
typecheck_pid=$!
run_check biome ./node_modules/.bin/biome check . --colors=off &
biome_pid=$!
run_check drizzle bunx drizzle-kit check &
drizzle_pid=$!
run_check build bun run build &
build_pid=$!
wait "$typecheck_pid"
typecheck_status=$?
wait "$biome_pid"
biome_status=$?
wait "$drizzle_pid"
drizzle_status=$?
wait "$build_pid"
build_status=$?
report_success() {
local name="$1"
echo "::notice title=${name} passed::${name} completed successfully."
}
report_failure() {
local name="$1"
echo "::error title=${name} failed::${name} failed. Expand the '${name} output' log group below or download the quality-reports artifact."
echo "::group::${name} output"
cat "quality-${name}.txt"
echo "::endgroup::"
{
echo "## ${name} failed"
echo
echo '```text'
cat "quality-${name}.txt"
echo '```'
echo
} >> "$GITHUB_STEP_SUMMARY"
}
[ "$typecheck_status" -eq 0 ] && report_success typecheck || report_failure typecheck
[ "$biome_status" -eq 0 ] && report_success biome || report_failure biome
[ "$drizzle_status" -eq 0 ] && report_success drizzle || report_failure drizzle
[ "$build_status" -eq 0 ] && report_success build || report_failure build
if [ "$typecheck_status" -ne 0 ] || [ "$biome_status" -ne 0 ] || [ "$drizzle_status" -ne 0 ] || [ "$build_status" -ne 0 ]; then
exit 1
fi
- name: Upload quality reports
if: ${{ failure() && !env.ACT }}
uses: actions/upload-artifact@v7
with:
name: quality-reports
path: quality-*.txt