тест
All checks were successful
Run Tests / run_tests (push) Successful in 46s

This commit is contained in:
Olga Nemt 2024-12-18 11:49:05 +05:00
parent a1fa5651c8
commit 7a2b369cfe

View File

@ -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
- 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:
# dotnet-version: 8.0.x
# - name: Check out repository code
# uses: actions/checkout@v4
# - name: Run integration tests
# python-version: 3.10
# token: ${{ secrets.GH_TOKEN }}
# - name: Install dependencies
# run: cd ${{ gitea.workspace }} && pdm install
# - name: Run Django tests
# env:
# POSTGRES_HOST: persistence-cicd-test-postgres-db
# POSTGRES_PORT: ${{ env.POSTGRES_PORT }}
# run: dotnet test DD.Persistence.IntegrationTests
# DB_HOST: 127.0.0.1
# DB_NAME: gastronaut
# DB_USER: postgres
# DB_PASSWORD: test123
# run: |
# cd ${{ gitea.workspace }} && pdm run manage.py test