-
Notifications
You must be signed in to change notification settings - Fork 65
125 lines (101 loc) · 3.75 KB
/
Copy pathci.yml
File metadata and controls
125 lines (101 loc) · 3.75 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
121
122
123
124
125
name: CI
run-name: >-
${{
github.event_name == 'push' &&
format('CI: {0}', github.event.head_commit.message) ||
format('CI: {0}', github.sha)
}}
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
DATABASE_URL: postgres://testuser:testpwd@localhost:5432/pubpub-testdb
DATABASE_READ_REPLICA_1_URL: postgres://testuser:testpwd@localhost:5432/pubpub-testdb
DATABASE_READ_REPLICA_2_URL: postgres://testuser:testpwd@localhost:5432/pubpub-testdb
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpwd
POSTGRES_DB: pubpub-testdb
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
postgresql-client \
xsltproc \
poppler-utils \
imagemagick \
libxml2 \
libxml2-utils
- name: Install pandoc
run: |
curl -L -o /tmp/pandoc.deb https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-1-amd64.deb
sudo dpkg -i /tmp/pandoc.deb
- name: Set up Java (for Firebase emulators)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- name: Validate setup
run: |
echo "=== Validating all dependencies ==="
echo "Node.js version:"
node --version
echo "pnpm version:"
pnpm --version
echo "Java version:"
java -version 2>&1 | head -1
echo "Checking required binaries..."
for bin in pandoc xsltproc pdftoppm convert xmllint; do
if command -v "$bin" &> /dev/null; then
echo " $bin: $(which $bin)"
else
echo " ERROR: $bin not found"
exit 1
fi
done
echo "Checking PostgreSQL connection..."
pg_isready -h localhost -p 5432 -U testuser || exit 1
echo "Checking Firebase CLI..."
which firebase || echo "Firebase CLI will be installed"
echo "=== All validations passed ==="
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Firebase CLI
run: pnpm install -g firebase-tools@10
- name: Verify Firebase CLI
run: firebase --version
- name: Build client
run: pnpm run build-prod
- name: Run tests
run: pnpm run test