Skip to content

Python application test on many versions #21

Python application test on many versions

Python application test on many versions #21

# 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*
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
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
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
pip install 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}