Skip to content

Add CI running integration tests and creating docker image #90

Add CI running integration tests and creating docker image

Add CI running integration tests and creating docker image #90

Workflow file for this run

name: CI build
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *' # every day at 10am
push:
branches:
- master
tags:
- 'v*.*.*'
pull_request:
permissions: read-all
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Run compose
run: |
cd $GITHUB_WORKSPACE/compose
docker compose -f docker-compose-integration-tests.yml up -d
- name: Prepare python environment
run: |
cd $GITHUB_WORKSPACE
pip install -r requirements.txt
- name: Wait for Directory service
run: |
cd $GITHUB_WORKSPACE/tests/scripts
python wait_for_service.py
- name: Load test data for Directory
run: |
cd $GITHUB_WORKSPACE/tests/scripts
python load_directory_data.py
sleep 120
- name: Run Integration tests
run: |
cd $GITHUB_WORKSPACE/tests/integration
pytest integration_tests.py
- name: Down compose
run: |
cd $GITHUB_WORKSPACE/compose
docker compose -f docker-compose-integration-tests.yml down
- name: Run service deploy tests
run: |
cd $GITHUB_WORKSPACE/tests/deployment
pytest standalone_service_test.py
build-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Build Docker image
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
tags: directory-negotiation-sync:latest
outputs: type=docker,dest=/tmp/directory-negotiator-sync.tar
- name: Upload docker image
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: directory-negotiator-sync
path: /tmp/directory-negotiator-sync.tar