oapen-suggestion-service/.github/workflows/test-containers.yml

28 lines
893 B
YAML
Raw Permalink Normal View History

name: Build and test containers
on: push
jobs:
docker:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create .env file
run: |
cp .env.template .env
sed -i 's/POSTGRES_SSLMODE=require/POSTGRES_SSLMODE=allow/' .env
- name: Create dummy certificate
run: |
mkdir api/certificates
touch api/certificates/dummy-cert.crt
- name: Create PostgreSQL container
run: docker run -d --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgrespw postgres
- name: Start containers
run: docker-compose -f "docker-compose.yml" up -d --build
- name: Unit tests for oapen-engine
run: docker-compose run --entrypoint "./scripts/tests.sh" oapen-engine
- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down