bar #93
Workflow file for this run
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: | |
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@v1 | |
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@v3 | |
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@v1 | |
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@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
rpm: | |
runs-on: ubuntu-latest | |
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 "::set-output name=version::$two" | |
echo "::set-output name=fname::$fname" | |
continue-on-error: false | |
# now run a couple integration test with RPM installed package | |
- name: Set up MicroMamba | |
uses: mamba-org/setup-micromamba@v1 | |
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 | |
wheel: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up MicroMamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment.yml | |
condarc: | | |
channels: | |
- conda-forge | |
- default | |
cache-environment: true | |
- name: Build wheel | |
shell: bash -l {0} | |
run: python -m build --wheel |