advance version number to 3.3.3 #177
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: main | |
tags: ['v*'] | |
workflow_dispatch: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up MicroMamba | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: environment.yml | |
condarc: | | |
channels: | |
- conda-forge | |
- default | |
cache-environment: true | |
- name: Unit test with code coverage | |
shell: bash -l {0} | |
run: python -m pytest -vv --cov=postprocessing --cov=scripts --cov-report=xml --cov-report=term | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
if: | |
github.actor != 'dependabot[bot]' | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
integration-tests: | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up MicroMamba | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: environment.yml | |
condarc: | | |
channels: | |
- conda-forge | |
- default | |
cache-environment: true | |
- name: Start docker containers | |
run: docker compose -f tests/integration/docker-compose.yml up --build -d | |
- name: Sleep, wait for containers to start up | |
run: sleep 2 | |
- name: Run integration tests | |
shell: bash -l {0} | |
run: python -m pytest tests/integration | |
- name: Stop but dont remove docker containers | |
# Stopping the containers allows the code coverage to be written to disk | |
run: docker compose -f tests/integration/docker-compose.yml stop | |
- name: Copy code coverage out of docker container | |
run: docker cp integration-post_processing_agent-1:/opt/postprocessing/ /tmp/ | |
- name: Combine and show code coverage | |
shell: bash -l {0} | |
run: | | |
cd /tmp/postprocessing | |
coverage combine | |
coverage xml | |
cp coverage.xml $OLDPWD | |
coverage report | |
- name: Bring down docker containers completely now | |
# This will completely remove the containers | |
run: docker compose -f tests/integration/docker-compose.yml down | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
if: | |
github.actor != 'dependabot[bot]' | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
rpm: | |
runs-on: ubuntu-latest | |
needs: integration-tests | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Build RPM inside Docker | |
run: | | |
docker build --tag postprocess -f Dockerfile . | |
fname=`docker run --name postprocess postprocess ls /root/rpmbuild/RPMS/noarch` | |
docker cp postprocess:/root/rpmbuild/RPMS/noarch/$fname . | |
one=${fname#*postprocessing-} | |
two=${one%.noarch*} | |
echo "{version}={$two}" >> $GITHUB_OUTPUT | |
echo "{fname}={$fname}" >> $GITHUB_OUTPUT | |
continue-on-error: false | |
# now run a couple integration test with RPM installed package | |
- name: Set up MicroMamba | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: environment.yml | |
condarc: | | |
channels: | |
- conda-forge | |
- default | |
cache-environment: true | |
- name: Start docker containers | |
run: docker compose -f tests/integration/docker-compose-rpm.yml up --build -d | |
- name: Sleep, wait for containers to start up | |
run: sleep 2 | |
- name: Run integration tests | |
shell: bash -l {0} | |
run: python -m pytest -k "test_heartbeat or test_missing_data" | |
- name: Bring down docker containers | |
run: docker compose -f tests/integration/docker-compose-rpm.yml down |