-
Notifications
You must be signed in to change notification settings - Fork 63
118 lines (95 loc) · 2.52 KB
/
pr_checks_backend.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: PR Checks Backend
on:
pull_request:
branches:
- staging
paths:
- 'data/**'
- 'Dockerfile-pg'
- 'init_pg.sql'
- 'docker compose.yml'
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Compose
uses: docker/setup-qemu-action@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.4'
run-formatter:
runs-on: ubuntu-latest
needs: setup
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Ruff Formatter in Docker
run: |
cd data
docker compose run --rm formatter
run-linter:
runs-on: ubuntu-latest
needs: setup
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Ruff Linter in Docker
run: |
cd data
docker compose run --rm linter
build-project:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build vacant-lots-proj
run: |
cd data
docker compose build vacant-lots-proj
run-services:
runs-on: ubuntu-latest
needs: build-project
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run all services
run: |
cd data
docker compose up -d
check-build-status:
runs-on: ubuntu-latest
needs: run-services
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check build status
if: failure()
run: |
echo "One or more services failed to build and run."
exit 1
- name: Report success
if: success()
run: echo "All services built and ran successfully."
check-lint-format-status:
runs-on: ubuntu-latest
needs: [run-formatter, run-linter]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check formatter and linter status
if: failure()
run: |
echo "Formatting or linting issues found. Please fix the issues."
exit 1
- name: Formatter and linter success
if: success()
run: echo "Formatting and linting passed successfully."