Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/backup_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"

Expand All @@ -32,13 +32,27 @@ jobs:
- name: dump the database
run: |
flyctl proxy 5432:5432 -a zootable-na-db &
PROXY_PID=$!

# Wait for proxy to be ready
sleep 5
for i in {1..30}; do
if pg_isready -h localhost -U na_zootable -d zootable; then
echo "Database proxy is ready"
break
fi
echo "Waiting for database proxy... ($i/30)"
sleep 2
done

docker run --rm --network host \
-v $(pwd):$(pwd) \
-w $(pwd) \
-e PGPASSWORD=$PGPASSWORD \
postgres:14-alpine \
pg_dump -Fc -h localhost -U na_zootable zootable > zootable.dump
kill %1

kill $PROXY_PID || true

- name: upload the db dump to dropbox
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ jobs:
options: --mount type=tmpfs,destination=/var/lib/postgresql/data --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
enable-cache: true
cache-dependency-glob: "requirements**.txt"

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"

Expand All @@ -50,7 +50,7 @@ jobs:
pytest --cov=zoo_checks --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
files: ./coverage.xml
fail_ci_if_error: false
Expand Down