Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
name: Integration Tests
on:
workflow_run:
workflows: ["Build Docker"]
types:
- completed
branches:
- main
- 'feature/*'
jobs:
integration-tests:
name: Run Integration Tests
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_sha }}
fetch-depth: 0
- name: Set up Docker Compose
uses: docker/setup-compose-action@v1
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull Docker Image
run: |
docker pull ghcr.io/robertgawron/hardwaredatalogger:${{ github.event.workflow_run.head_sha }}
docker tag ghcr.io/robertgawron/hardwaredatalogger:${{ github.event.workflow_run.head_sha }} hardwaredatalogger:latest
- name: Run Docker Compose
env:
DOCKER_IMAGE: ghcr.io/robertgawron/hardwaredatalogger:${{ github.event.workflow_run.head_sha }}
run: |
docker compose -f docker-compose.yml up -d
- name: Run Integration Tests
run: |
docker compose -f docker-compose.yml exec -T dev bash -c "pip install -e /workspace/Software/STM32F103RBTx/Application/Driver/Host/Python/ && cd /workspace/build/ && cmake -DCMAKE_BUILD_TYPE=Debug .. && make -j24 && cd /workspace/IntegrationTest && pytest test_*.py -s --html=/workspace/build/BuildArtifacts/IntegrationTest.html"
- name: Upload Integration Tests Results
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-tests-results
path: DevOps/BuildArtifacts/IntegrationTest.html
- name: Clean up Docker containers
if: always()
run: |
docker compose -f docker-compose.yml down693a2df9fThis file is pinned to the selected release. Download the original to open it in your design tool.