Skip to content

Commit

Permalink
ci: postgres in ci
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Zak <[email protected]>
  • Loading branch information
rjzak committed Sep 9, 2023
1 parent 1efcb3e commit f8ad745
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,38 @@ jobs:
sqlite3 test.db < $src
done
ls -la test.db
postgres:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: whatever1
POSTGRES_DB: testdb
POSTGRES_USER: postgres
ports:
- 5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install git
run: |
sudo apt-get install -y git
shell: bash
- name: Checkout MalwareDB
run: |
git clone https://github.com/malwaredb/malwaredb-rs.git
- name: Create database
run: |
PGPASSWORD=whatever1 psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d testdb -f malwaredb-rs/crates/server/src/db/malwaredb_pg.sql
- name: Load sources
run: |
for src in `ls sources/*.sql`
do
PGPASSWORD=whatever1 psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d testdb -f $src
done

0 comments on commit f8ad745

Please sign in to comment.