update Dockerfile #33
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: Build and Test | |
on: | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate) | |
required: false | |
default: false | |
pull_request: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-test: | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest, macos-latest] | |
geant4-version: | |
- 11.1.3 | |
python-version: | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
runs-on: ${{ matrix.platform }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Get conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Install Geant4 via conda | |
run: | | |
conda env list | |
mamba install -c conda-forge geant4=${{ matrix.geant4-version }} | |
conda list | |
- name: Install additional dependencies (ubuntu) | |
if: matrix.platform == 'ubuntu-latest' | |
# TODO: fix the cmake so it doesn't try to find graphical libraries | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y mesa-common-dev libglu1-mesa-dev python3-dev | |
- name: Install additional dependencies (macos) | |
if: matrix.platform == 'macos-latest' | |
run: | | |
conda env list | |
mamba install -c conda-forge zlib | |
conda list | |
- name: pip | |
run: | | |
pip install .[test] | |
- name: Check imports | |
run: | | |
python -c "import geant4_python_application; geant4_python_application.Application()" | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
with: | |
limit-access-to-actor: false | |
- name: Run tests | |
run: | | |
python -m pytest -vv tests |