Skip to content

Commit

Permalink
build geant4 in macos
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Dec 3, 2023
1 parent 4fe11cb commit e82c86e
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
platform: [ubuntu-latest, macos-latest]
geant4-version:
- 11.1.3

Expand All @@ -39,8 +39,13 @@ jobs:
sudo apt-get install -y build-essential git curl libexpat-dev libxerces-c-dev
pip install cmake
- name: Check Cache
id: cache
- name: Install additional dependencies (macos)
if: matrix.platform == 'macos-latest'
run: |
brew install git curl cmake xerces-c expat
- name: Check Cache for Geant4 Installation
id: cache-geant4
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/geant4
Expand All @@ -49,7 +54,7 @@ jobs:
geant4-${{ matrix.geant4-version }}-${{ matrix.platform }}
- name: Build and Install Geant4 (without data)
if: steps.cache.outputs.cache-hit != 'true'
if: steps.cache-geant4.outputs.cache-hit != 'true'
run: |
git clone https://github.com/Geant4/geant4.git ${{ github.workspace }}/geant4-source --depth 1 --branch v${{ matrix.geant4-version }}
mkdir -p ${{ github.workspace }}/geant4-source/build mkdir -p ${{ github.workspace }}/geant4
Expand All @@ -61,23 +66,22 @@ jobs:
geant4-config --version
- name: Cache Geant4 Installation
if: steps.cache.outputs.cache-hit != 'true'
if: steps.cache-geant4.outputs.cache-hit != 'true'
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/geant4
key: geant4-${{ matrix.geant4-version }}-${{ matrix.platform }}
restore-keys: |
geant4-${{ matrix.geant4-version }}-${{ matrix.platform }}
- name: Check after cache
- name: Check After Geant4 Installation
run: |
ls -l ${{ github.workspace }}/geant4
source ${{ github.workspace }}/geant4/bin/geant4.sh
geant4-config --version
geant4-config --prefix
geant4-config --datasets
geant4-config --check-datasets
- name: Check Cache
- name: Check Cache for Geant4 Datasets
id: cache-geant4-data
uses: actions/cache@v2
with:
Expand All @@ -86,14 +90,14 @@ jobs:
restore-keys: |
geant4-${{ matrix.geant4-version }}-data
- name: Install Geant4 data
- name: Install Geant4 Datasets
if: steps.cache-geant4-data.outputs.cache-hit != 'true'
run: |
source ${{ github.workspace }}/geant4/bin/geant4.sh
geant4-config --install-datasets
geant4-config --check-datasets
- name: Cache Geant4 data
- name: Cache Geant4 Datasets
if: steps.cache-geant4-data.outputs.cache-hit != 'true'
uses: actions/cache@v2
with:
Expand All @@ -103,6 +107,13 @@ jobs:
geant4-${{ matrix.geant4-version }}-data
enableCrossOsArchive: true

- name: Check After Geant4 Datasets Installation
run: |
ls -l ${{ github.workspace }}/geant4
source ${{ github.workspace }}/geant4/bin/geant4.sh
geant4-config --version
geant4-config --check-datasets
build-test:
needs: [build-geant4]
timeout-minutes: 30
Expand Down

0 comments on commit e82c86e

Please sign in to comment.