generated from cds-snc/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.7 KB
/
ci_code.yml
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
name: Lint, format and test code
on:
workflow_dispatch:
pull_request:
paths:
- api/**
jobs:
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15.5@sha256:11019308d1b8c73d225f1c3b8ddcb1380d5957e7b934ef27050b1f91c8859ce2
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: list-manager
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
folder: ["api"]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.9"
- name: Setup node
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: "14"
- name: Install dev dependencies
working-directory: ${{ matrix.folder }}
run: make install-dev
- name: Install dependencies
working-directory: ${{ matrix.folder }}
run: make install
- name: Lint
working-directory: ${{ matrix.folder }}
run: make lint-ci
- name: Format
working-directory: ${{ matrix.folder }}
run: make fmt-ci
- name: Test
working-directory: ${{ matrix.folder }}
env:
SQLALCHEMY_DATABASE_URI: postgresql://postgres:[email protected]/list-manager
SQLALCHEMY_DATABASE_TEST_URI: postgresql://postgres:[email protected]/list-manager
run: make test