-
Notifications
You must be signed in to change notification settings - Fork 88
85 lines (70 loc) · 2.02 KB
/
backend_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
name: Backend CI
on:
push:
branches: main
paths:
- "backend/**"
- ".github/workflows/backend_ci.yml"
pull_request:
branches: main
paths:
- "backend/**"
- ".github/workflows/backend_ci.yml"
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup Poetry
run: |
curl -sSL https://install.python-poetry.org | python -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential libcairo2-dev libgirepository1.0-dev gir1.2-ostree-1.0
poetry install
- name: Check code formatting
run: poetry run ruff format --check .
- name: Check for code errors
run: poetry run ruff check .
smoketests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: backend
tags: backend_backend
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build Docker backend-node image
uses: docker/build-push-action@v6
with:
context: backend-node
tags: backend-node
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Execute smoke tests
run: |
docker compose --env-file .env.ci up --no-build -d
bash tests/run_tests.sh