feature/#524-pipline #15
@ -1,63 +1,40 @@
|
|||||||
name: Unit tests
|
name: Run Tests
|
||||||
run-name: ${{ gitea.actor }} is testing
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||||
on: push
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
container-network-test:
|
run_tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
container: catthehacker/ubuntu:act-latest
|
||||||
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
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout Codebase
|
||||||
- name: Run docker action and test network connection
|
uses: actions/checkout@v4
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
image: postgres
|
|
||||||
run: >
|
|
||||||
pg_isready -d test -U test -h postgres -p 5442
|
|
||||||
options: >
|
|
||||||
-e PGPASSWORD=postgres
|
|
||||||
# test:
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
# # Service containers to run with `runner-job`
|
|
||||||
# services:
|
- name: Configure and install postgres
|
||||||
# # Label used to access the service container
|
run: |
|
||||||
# postgres:
|
apt update
|
||||||
# # Docker Hub image
|
apt install -y postgresql
|
||||||
# image: postgres
|
service postgresql start
|
||||||
# # Provide the password for postgres
|
sudo -u postgres -s psql -U postgres -d postgres -c "alter user postgres with password 'postgres';"
|
||||||
# # hostname: ${{ env.POSTGRES_HOST }}
|
|
||||||
# env:
|
|
||||||
# POSTGRES_USER: ${{ env.POSTGRES_USER }}
|
# - uses: pdm-project/setup-pdm@v3
|
||||||
# POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
|
# with:
|
||||||
# # Set health checks to wait until postgres has started
|
# python-version: 3.10
|
||||||
# options: >-
|
# token: ${{ secrets.GH_TOKEN }}
|
||||||
# --health-cmd pg_isready
|
|
||||||
# --health-interval 10s
|
|
||||||
# --health-timeout 5s
|
# - name: Install dependencies
|
||||||
# --health-retries 5
|
# run: cd ${{ gitea.workspace }} && pdm install
|
||||||
# ports:
|
|
||||||
# # Maps tcp port 5432 on service container to the host
|
|
||||||
# - '${{ env.POSTGRES_PORT }}:5432'
|
# - name: Run Django tests
|
||||||
|
# env:
|
||||||
# steps:
|
# DB_HOST: 127.0.0.1
|
||||||
# - name: Setup dotnet
|
# DB_NAME: gastronaut
|
||||||
# uses: actions/setup-dotnet@v4
|
# DB_USER: postgres
|
||||||
# with:
|
# DB_PASSWORD: test123
|
||||||
# dotnet-version: 8.0.x
|
|
||||||
# - name: Check out repository code
|
# run: |
|
||||||
# uses: actions/checkout@v4
|
# cd ${{ gitea.workspace }} && pdm run manage.py test
|
||||||
# - name: Run integration tests
|
|
||||||
# env:
|
|
||||||
# POSTGRES_HOST: persistence-cicd-test-postgres-db
|
|
||||||
# POSTGRES_PORT: ${{ env.POSTGRES_PORT }}
|
|
||||||
# run: dotnet test DD.Persistence.IntegrationTests
|
|
Loading…
Reference in New Issue
Block a user