diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml new file mode 100644 index 0000000..91ea2ef --- /dev/null +++ b/.github/workflows/database.yml @@ -0,0 +1,34 @@ +name: database +on: [push] +jobs: + database-creation: + runs-on: ubuntu-latest + + services: + # Label used to access the service container + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + # Maps tcp port 5432 on service container to the host + - 5432:5432 + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Install dependencies + run: pip3 install mariadb + + - name: Connect to PostgreSQL + run: python3 database/db-creation.py + env: + POSTGRES_HOST: postgres + POSTGRES_PORT: 5432