-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (50 loc) · 1.44 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
# This file will be used when creating PRs to the develop branch.
# It should run the tests without building the docker images.
name: CI
on:
pull_request:
branches: [develop] # If more branches are needed, add them here.
types: [synchronize, opened, reopened, ready_for_review]
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Cache PDM packages
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-pdm-${{ hashFiles('pdm.lock') }}
restore-keys: |
${{ runner.os }}-pdm-
- name: Install dependencies
run: |
python -m pip install pdm
pdm install
ls -la ./
pdm info
pdm list
- name: Start db
run: docker compose run --rm -d db
- name: Wait for db
run: |
docker ps -a
for i in {1..60}; do
if docker compose exec db pg_isready -U hcw -d hope_country_workspace; then
echo "Database is up!"
exit 0
fi
echo "Waiting for database..."
sleep 1
done
echo "Database is not available."
docker ps -a
exit 1
- name: Run tests
run: pdm run pytest