Python application test on many versions #27
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
# This action is intended to run weekly on also testing versions of python | |
name: Python application test on many versions | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 3 * * 0' | |
permissions: | |
contents: read | |
env: | |
PYTHONPATH: '/usr/local/lib' | |
jobs: | |
build: | |
timeout-minutes: 20 | |
env: | |
PYTHONPATH: "/usr/local/lib/python${{matrix.pyv}}/site-packages" | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
pyv: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{matrix.pyv}} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{matrix.pyv}} | |
- name: basic dependencies | |
run: | | |
sudo apt-get update | |
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections | |
sudo apt-get -y install libhdf5-103 xserver-xorg-core xserver-xorg-dev libx11-6 libgl1 libxcursor1 libglu1-mesa libxinerama1 libxft2 | |
- name: setup a micromamba environment to get at openmc etc. | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-name: cad_to_openmc_Testing | |
create-args: >- | |
python=${{matrix.pyv}} | |
openmc=0.14.0=dagmc_mpi_openmpi* | |
ocp=7.7.2.1 | |
cadquery=2.4.0 | |
init-shell: bash | |
- name: Test OpenMC | |
run: openmc --version | |
shell: micromamba-shell {0} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 build pytest | |
grep -v cadq requirements.txt > reqs_cleaned.txt | |
pip install -r reqs_cleaned.txt | |
micromamba list | |
python -c "import gmsh" | |
shell: micromamba-shell {0} | |
- name: Build, pip-install, and test-import CAD_to_OpenMC with dependencies. | |
run: | | |
python -m build --sdist . | |
pip install --no-deps dist/cad_to_openmc*.tar.gz | |
python -c 'import CAD_to_OpenMC.assembly' | |
shell: micromamba-shell {0} | |
- name: Run Tests | |
run: | | |
pytest -v --debug=debuglog.log tests | |
shell: micromamba-shell {0} |