From bcbc3db00dfe80379a0aeaf60b1967d15a5a3595 Mon Sep 17 00:00:00 2001 From: Richard Zak Date: Sat, 9 Sep 2023 13:54:52 -0400 Subject: [PATCH] ci: postgres in ci Signed-off-by: Richard Zak --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b72f748..8d28449 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,3 +22,37 @@ 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 + 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 -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 -d testdb -f $src + done \ No newline at end of file