Bump actions/checkout from 5 to 6 #41
This file contains hidden or 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: conda | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: '30 18 * * 0' # 18:30 every Sunday | |
| jobs: | |
| precheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| path: src | |
| - name: Pip install deps | |
| run: pip install ruff | |
| - name: mcplg4devtool checks | |
| run: ./src/devel/bin/mcplg4devtool --check | |
| build: | |
| needs: [ precheck ] | |
| strategy: | |
| #fail-fast: false | |
| matrix: | |
| include: | |
| #NB: Due to cache size limitations we should have at most 3 or 4 platforms here!! | |
| #NB: No Geant4 conda pkgs on windows | |
| #NB: No linux-aarch64 geant4 pkg: - { os: ubuntu-24.04-arm, g4spec: 'geant4' } | |
| - { os: ubuntu-latest, g4spec: 'geant4==11.1.3' } | |
| - { os: ubuntu-latest, g4spec: 'geant4' } | |
| - { os: macos-latest, g4spec: 'geant4==11.1.3' } | |
| - { os: macos-latest, g4spec: 'geant4' } | |
| #Not supported (unclear why it doesn't work though): - { os: macos-13, g4spec: 'geant4' } | |
| name: ${{ matrix.os }}-${{ matrix.g4spec }} | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| env: | |
| CONDA_SOLVER: libmamba | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| path: ./src | |
| - name: Setup Miniforge | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| activate-environment: anaconda-client-env | |
| - name: Get Date | |
| id: get-date | |
| run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Cache Conda env | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.CONDA }}/envs | |
| key: | |
| conda-${{ runner.os }}--${{ runner.arch }}--${{ | |
| steps.get-date.outputs.today }}-${{ matrix.g4spec }}-${{ | |
| hashFiles('./src/.github/resources/condamcplg4.yml') }} | |
| - name: Update environment | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: | | |
| mamba env update -n anaconda-client-env -f ./src/.github/resources/condamcplg4.yml | |
| mamba install -n anaconda-client-env "${{ matrix.g4spec }}" | |
| - name: Inspect environment | |
| run: | | |
| conda info | |
| conda list | |
| set -x | |
| cmake --version | |
| pip list | |
| - name: Install source | |
| run: pip install ./src | |
| - name: Cfg example_write | |
| run: cmake -S ./src/example_write -B ./bldexample_write -DCMAKE_INSTALL_PREFIX=./instexample_write | |
| - name: Build example_write | |
| run: cmake --build ./bldexample_write | |
| - name: Install example_write | |
| run: cmake --install ./bldexample_write | |
| - name: Run example_write | |
| run: ./instexample_write/bin/myapp | |
| - run: mcpltool myoutput.mcpl.gz | |
| - name: Cfg example_read | |
| run: cmake -S ./src/example_read -B ./bldexample_read -DCMAKE_INSTALL_PREFIX=./instexample_read | |
| - name: Build example_read | |
| run: cmake --build ./bldexample_read | |
| - name: Install example_read | |
| run: cmake --install ./bldexample_read | |
| - name: Run example_read | |
| run: ./instexample_read/bin/myapp myoutput.mcpl.gz |