Skip to content

Commit 1cbcc02

Browse files
authored
feat: add CI (#34)
1 parent adb7aba commit 1cbcc02

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI 🛠️
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_requests:
7+
type: [opened, synchronize]
8+
merge_groups:
9+
type: [checks_requested]
10+
11+
jobs:
12+
build:
13+
name: Build, Test and Lint
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Check out code
18+
uses: actions@checkout@v4
19+
with:
20+
fetch-depth: 2
21+
22+
- name: Cache turbo build setup
23+
uses: actions/cache@v4
24+
with:
25+
path: .turbo
26+
keys: ${{ runner.os }}-turbo-${{ github.sha }}
27+
restore-keys: |
28+
${{ runner.os }}-turbo-
29+
30+
- name: Install build dependencies
31+
run: |
32+
sudo apt-get update
33+
34+
- name: Setup Node.JS environment
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 22
38+
39+
- name: Install pnpm via corepack
40+
shell: bash
41+
run: |
42+
corepack enable
43+
corepack prepare --activate
44+
45+
- name: Get pnpm store directory
46+
id: pnpm-cache
47+
shell: |
48+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
49+
50+
- name: Setup pnpm cache
51+
uses: actions/cache@v4
52+
with:
53+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
54+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
55+
restore-keys: |
56+
${{ runner.os }}-pnpm-store-
57+
58+
- name: Install dependencies
59+
run: pnpm install
60+
61+
- name: Build
62+
run: pnpm build
63+
env:
64+
SQLX_OFFLINE: true
65+
66+
- name: Lint
67+
run: pnpm lint
68+
env:
69+
SQLX_OFFLINE: true
70+
71+
- name: Start docker compose
72+
run: docker-compose -f docket-compose.test.yaml -d
73+
74+
- name: Test
75+
run: pnpm test
76+
env:
77+
SQLX_OFFLINE: true
78+
DATABASE_URL: postgresql://unen:unen@localhost/unen

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6+
"web:build": "turbo run web:build --continue",
7+
"web:dev": "turbo run web:dev --continue",
8+
"web:lint": "turbo run web:lint --continue",
9+
"web:test": "turbo run web:test --continue",
10+
"engine:build": "turbo run engine:build --continue",
11+
"engine:dev": "turbo run engine:dev --continue",
12+
"engine:lint": "turbo run engine:lint --continue",
13+
"engine:test": "turbo run engine:test --continue",
614
"build": "turbo run build --continue",
715
"dev": "turbo run dev --continue",
816
"lint": "turbo run lint --continue",

0 commit comments

Comments
 (0)