Merge pull request #56 from isteinbrecher/dont-print-emppyt-bc-sections #180
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
workflow_dispatch: | |
type: choice | |
jobs: | |
testing: | |
name: cubitpy-testing | |
runs-on: self-hosted | |
env: | |
CUBIT_ROOT: /imcs/public/compsim/opt/cubit-15.2 | |
PYTHON_VENV: python-testing-environment | |
SPACK_ACTIVATION_SCRIPT: /home_local/github-runner/testing_lib/spack/share/spack/setup-env.sh | |
TESTING_GITHUB: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup virtual environment and run tests | |
run: | | |
whoami | |
pwd | |
export CUBITPY_PATH="$(pwd)" | |
# Activate spack and load python | |
. ${SPACK_ACTIVATION_SCRIPT} | |
spack load python@3.12.1 | |
# Create the virtual environment | |
python -m venv $PYTHON_VENV | |
source $PYTHON_VENV/bin/activate | |
# Update pip | |
pip install --upgrade pip | |
# Install cubitpy | |
pip install .[CI-CD] | |
# Print information on the python environment | |
python --version | |
pip list | |
# Run tests | |
cd tests | |
coverage run --rcfile=coverage.config -m pytest *.py | |
coverage html | |
coverage report | |
coverage-badge -o htmlcov/coverage.svg | |
# This tests that if cubit is completely closed everything works | |
./test_configurations.sh | |
# Check codestyle | |
cd $CUBITPY_PATH | |
black . --check --exclude=$PYTHON_VENV && exit 0 | |
# If we did not exit earlier, raise an error here | |
exit 1 |