Skip to content

Commit 9fa9693

Browse files
committed
ci(sftkit): add postgres service container to ci
1 parent ba56e18 commit 9fa9693

File tree

7 files changed

+57
-11
lines changed

7 files changed

+57
-11
lines changed

.github/workflows/ci.yaml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,33 @@ jobs:
3131
- name: Lint
3232
run: npx nx run-many --target=lint
3333

34-
test:
35-
runs-on: ubuntu-latest
34+
test-py:
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
matrix:
38+
python-version: [ 3.11 ]
39+
os: [ ubuntu-latest ]
40+
postgres-version: [ 15-bookworm ]
41+
services:
42+
postgres:
43+
image: postgres:${{ matrix.postgres-version }}
44+
env:
45+
POSTGRES_PASSWORD: "password"
46+
POSTGRES_USER: "sftkit"
47+
POSTGRES_DB: "sftkit_test"
48+
options: >-
49+
--health-cmd pg_isready
50+
--health-interval 10s
51+
--health-timeout 5s
52+
--health-retries 5
53+
ports:
54+
- 5432:5432
55+
env:
56+
SFTKIT_TEST_DB_USER: "sftkit"
57+
SFTKIT_TEST_DB_HOST: "localhost"
58+
SFTKIT_TEST_DB_PORT: "5432"
59+
SFTKIT_TEST_DB_DBNAME: "sftkit_test"
60+
SFTKIT_TEST_DB_PASSWORD: "password"
3661
steps:
3762
- uses: actions/checkout@v4
3863

@@ -49,13 +74,34 @@ jobs:
4974
- name: Set up Python with PDM
5075
uses: pdm-project/setup-pdm@v3
5176
with:
52-
python-version: "3.11"
77+
python-version: ${{ matrix.python-version }}
5378

5479
- name: Install Python dependencies
5580
run: pdm sync -d
5681

5782
- name: Test
58-
run: npx nx run-many --target=test
83+
run: npx nx run-many --target=test --projects=tag:lang:python
84+
85+
test-js:
86+
runs-on: ubuntu-latest
87+
strategy:
88+
matrix:
89+
node-version: [ 20 ]
90+
steps:
91+
- uses: actions/checkout@v4
92+
93+
- name: Set up Nodejs
94+
uses: actions/setup-node@v4
95+
with:
96+
node-version: ${{ matrix.node-version}}
97+
cache: "npm"
98+
cache-dependency-path: package-lock.json
99+
100+
- name: Install node dependencies
101+
run: npm ci
102+
103+
- name: Test
104+
run: npx nx run-many --target=test --projects=tag:lang:javascript
59105

60106
build:
61107
runs-on: ubuntu-latest

sftkit/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "sftkit",
3-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"$schema": "../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "sftkit/sftkit",
55
"projectType": "library",
6-
"tags": [],
6+
"tags": ["lang:python"],
77
"targets": {
88
"typecheck": {
99
"executor": "nx:run-commands",

tools/nx-python/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "tools/nx-python/src",
55
"projectType": "library",
6-
"tags": [],
6+
"tags": ["lang:javascript"],
77
"targets": {
88
"build": {
99
"executor": "@nx/js:tsc",

web/components/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "web/components/src",
55
"projectType": "library",
6-
"tags": [],
6+
"tags": ["lang:javascript"],
77
"targets": {}
88
}

web/form-components/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "web/form-components/src",
55
"projectType": "library",
6-
"tags": [],
6+
"tags": ["lang:javascript"],
77
"targets": {}
88
}

web/modal-provider/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "web/modal-provider/src",
55
"projectType": "library",
6-
"tags": [],
6+
"tags": ["lang:javascript"],
77
"targets": {}
88
}

web/utils/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "web/utils/src",
55
"projectType": "library",
6-
"tags": [],
6+
"tags": ["lang:javascript"],
77
"targets": {}
88
}

0 commit comments

Comments
 (0)