From bf59f0c5cbb5426d1bf2479f8bf0eeea66f9bc63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20G=C3=B3recki?= Date: Fri, 9 Dec 2022 11:11:03 +0100 Subject: [PATCH 1/2] Create main.yml add github workflow --- .github/workflows/main.yml | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9a29991 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,54 @@ +name: Test + workflow_dispatch: + push: + pull_request: + +jobs: + # Label of the container job + container-job: + # Containers must run in Linux based operating systems + runs-on: ubuntu-latest + container: python:3.10 + + # Service containers to run with `container-job` + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_PASSWORD: password + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + # Downloads a copy of the code in your repository before running CI tests + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Poetry setup + # You may pin to the exact commit or the version. + # uses: ClementWalter/poetry-action@845abd0cfcc6671c045a2f9df189360bb73e64c4 + uses: ClementWalter/poetry-action@v1 + with: + # + os: + # + python-version: + + - name: Install dependencies + run: poetry install + + - name: Connect to PostgreSQL + # Runs a script that creates a PostgreSQL table, populates + # the table with data, and then retrieves the data. + run: pytest src + # Environment variables used by the `client.js` script to create a new PostgreSQL table. + env: + # The hostname used to communicate with the PostgreSQL service container + DATABASE_URL: postgresql://postgres:password@postgres:5432/postgres From 83d12e16a954397333d2866f3f8c6af9bb36183a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20G=C3=B3recki?= Date: Fri, 9 Dec 2022 11:16:26 +0100 Subject: [PATCH 2/2] Update main.yml --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a29991..ae0952b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: Test - workflow_dispatch: - push: - pull_request: +on: [workflow_dispatch] +# push +# pull_request jobs: # Label of the container job