From 7a2b369cfe172b15beff52c6b8f1b62f13103172 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Wed, 18 Dec 2024 11:49:05 +0500 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test.yaml | 93 ++++++++++++++------------------------ 1 file changed, 35 insertions(+), 58 deletions(-) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index e20ab9c..66e1c83 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -1,63 +1,40 @@ -name: Unit tests -run-name: ${{ gitea.actor }} is testing -on: push +name: Run Tests +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] jobs: - container-network-test: + run_tests: runs-on: ubuntu-latest - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - POSTGRES_DB: postgres - ports: - - 5442:5432 - options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10 + container: catthehacker/ubuntu:act-latest steps: - - uses: actions/checkout@v4 - - name: Run docker action and test network connection - uses: ./ - with: - image: postgres - run: > - pg_isready -d test -U test -h postgres -p 5442 - options: > - -e PGPASSWORD=postgres - # test: - # runs-on: ubuntu-latest + - name: Checkout Codebase + uses: actions/checkout@v4 - # # Service containers to run with `runner-job` - # services: - # # Label used to access the service container - # postgres: - # # Docker Hub image - # image: postgres - # # Provide the password for postgres - # # hostname: ${{ env.POSTGRES_HOST }} - # env: - # POSTGRES_USER: ${{ env.POSTGRES_USER }} - # POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} - # # 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 - # - '${{ env.POSTGRES_PORT }}:5432' - - # steps: - # - name: Setup dotnet - # uses: actions/setup-dotnet@v4 - # with: - # dotnet-version: 8.0.x - # - name: Check out repository code - # uses: actions/checkout@v4 - # - name: Run integration tests - # env: - # POSTGRES_HOST: persistence-cicd-test-postgres-db - # POSTGRES_PORT: ${{ env.POSTGRES_PORT }} - # run: dotnet test DD.Persistence.IntegrationTests + + - name: Configure and install postgres + run: | + apt update + apt install -y postgresql + service postgresql start + sudo -u postgres -s psql -U postgres -d postgres -c "alter user postgres with password 'postgres';" + + + # - uses: pdm-project/setup-pdm@v3 + # with: + # python-version: 3.10 + # token: ${{ secrets.GH_TOKEN }} + + + # - name: Install dependencies + # run: cd ${{ gitea.workspace }} && pdm install + + + # - name: Run Django tests + # env: + # DB_HOST: 127.0.0.1 + # DB_NAME: gastronaut + # DB_USER: postgres + # DB_PASSWORD: test123 + + # run: | + # cd ${{ gitea.workspace }} && pdm run manage.py test \ No newline at end of file