2023-03-22 18:52:38 +00:00
|
|
|
name: Build and test containers
|
2022-12-13 12:46:08 +00:00
|
|
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
2023-04-18 23:48:09 +00:00
|
|
|
timeout-minutes: 10
|
2022-12-13 12:46:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-04-18 23:48:09 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Create .env file
|
|
|
|
run: |
|
|
|
|
cp .env.template .env
|
|
|
|
sed -i 's/POSTGRES_SSLMODE=require/POSTGRES_SSLMODE=allow/' .env
|
2023-04-20 17:54:59 +00:00
|
|
|
- name: Create dummy certificate
|
|
|
|
run: |
|
|
|
|
mkdir api/certificates
|
|
|
|
touch api/certificates/dummy-cert.crt
|
2023-04-18 23:48:09 +00:00
|
|
|
- name: Create PostgreSQL container
|
|
|
|
run: docker run -d --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgrespw postgres
|
2022-12-13 12:46:08 +00:00
|
|
|
- name: Start containers
|
|
|
|
run: docker-compose -f "docker-compose.yml" up -d --build
|
2023-04-18 23:48:09 +00:00
|
|
|
- name: Unit tests for oapen-engine
|
|
|
|
run: docker-compose run --entrypoint "./scripts/tests.sh" oapen-engine
|
2022-12-13 12:46:08 +00:00
|
|
|
- name: Stop containers
|
|
|
|
if: always()
|
|
|
|
run: docker-compose -f "docker-compose.yml" down
|