-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (70 loc) · 2.1 KB
/
ci.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
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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
infrastructure:
runs-on: ubuntu-latest
steps:
- name: Install Terraform
run: |
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install terraform
- uses: actions/checkout@v3
- name: Initialise Terraform
run: terraform init
- name: Check the formatting
run: terraform fmt --check=true --recursive
- name: Validate the code
run: terraform validate
backend:
runs-on: ubuntu-latest
container: python:3.10.1-slim-bullseye
services:
postgres:
image: postgres
env:
POSTGRES_DB: tozo_test
POSTGRES_USER: tozo
POSTGRES_PASSWORD: todo_tozo
POSTGRES_HOST_AUTH_METHOD: "trust"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
defaults:
run:
working-directory: backend
env:
TOZO_QUART_DB_DATABASE_URL: "postgresql://tozo:todo_tozo@postgres:5432/tozo_test"
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: apt-get update && apt-get install -y postgresql postgresql-contrib
- name: Initialise dependencies
run: |
pip install pdm
pdm install
frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- uses: actions/checkout@v3
- name: Initialise dependencies
run: npm ci --cache .npm --prefer-offline
- name: Check formatting
run: npm run format
- name: Linting
run: npm run lint