Fix wrong use of material properties table interface in test #34
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: | |
pull_request: | |
push: | |
paths-ignore: | |
- README.md | |
- .gitignore | |
- doc | |
- docs | |
jobs: | |
build-and-test: | |
# See https://wildwolf.name/github-actions-how-to-avoid-running-the-same-workflow-multiple-times/ | |
if: (! contains(github.event.head_commit.message, '[skip ci]') && | |
! contains(github.event.head_commit.message, '[skip nain4]') && | |
((github.event_name != 'pull_request') || | |
(github.event.pull_request.head.repo.full_name != | |
github.event.pull_request.base.repo.full_name)) | |
) | |
runs-on: ${{ matrix.os }} | |
#continue-on-error: ${{ matrix.allow-fail }} | |
#continue-on-error: ${{ matrix.devshell == 'gcc' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, macos-12] | |
py: [311] | |
devshell: [ clang, gcc ] | |
#allow-fail: [false] | |
exclude: | |
- os: macos-12 | |
devshell: gcc | |
steps: | |
- uses: actions/checkout@v3.5.3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: cachix/install-nix-action@v22 | |
with: | |
nix_path: nixpkgs=channel:nixos-23.05 | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: nain4 # The name of the Cachix cache | |
# If you chose signing key for write access | |
#signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
# If you chose API tokens for write access OR if you have a private cache | |
authToken: '${{ secrets.CACHIX_JACG_NAIN4 }}' | |
- name: Build nix development environment | |
run: nix develop | |
- name: Compile nain4 | |
run: nix develop .#${{ matrix.devshell }} -c just install-nain4 | tee compilation-log | |
- name: Count warnings | |
run: bash ~/work/nain4/nain4/scripts/count-warnings.sh compilation-log scripts/tolerated-warnings do-not-fail-here | |
- name: Test nain4 | |
run: nix develop .#${{ matrix.devshell }} -c just test-nain4 -v | |
- name: Run client-side tests | |
run: nix develop .#${{ matrix.devshell }} -c just test-client-side | |
- name: Run compile-time tests | |
run: nix develop .#${{ matrix.devshell }} -c just test-compile-time | |
continue-on-error: ${{ matrix.os == 'macos-12' }} # bizarre time-dependent encoding errors in python test generator | |
- name: Test variables set by nain4 setupHook | |
run: | | |
nix develop .# -c env > nain4-project-env | |
echo ====== grepping for G4_DIR ==================== | |
grep G4_DIR nain4-project-env | |
echo =============================================== | |
echo ====== grepping for G4_EXAMPLES =============== | |
grep G4_EXAMPLES nain4-project-env | |
echo =============================================== | |
echo grepping for QT_QPA_PLATFORM_PLUGIN_PATH | |
grep QT_QPA_PLATFORM_PLUGIN_PATH nain4-project-env | |
echo =============================================== | |
- name: Run N4 examples | |
run: nix develop .#${{ matrix.devshell }} -c just n4-examples/run-all | |
- name: Run G4 examples | |
run: nix develop .#${{ matrix.devshell }} -c just g4-examples/run-examples-that-work | |
- name: Build Geant4 | |
run: nix build ./#geant4 | |
- name: Check for presence of debug symbols in Geant4 | |
run: | | |
nix profile install nixpkgs#ripgrep | |
if ${{ matrix.os == 'macos-12' }} | |
then | |
if rg --files-with-matches debug_info result/lib/libG4*.so | |
then echo DEBUG SYMBOLS FOUND | |
else echo FAILING BECAUSE DEBUG SYMBOLS NOT FOUND; false | |
fi | |
else | |
if rg --files-with-matches debug_info result/lib/libG4*.so | |
then echo DEBUG SYMBOLS FOUND | |
else echo FAILING BECAUSE DEBUG SYMBOLS NOT FOUND; false | |
fi | |
fi | |
continue-on-error: ${{ matrix.os == 'macos-12' }} # Don't know how to get debug symbols on macOS, yet. | |
- name: Fail if too many warnings | |
run: bash ~/work/nain4/nain4/scripts/count-warnings.sh compilation-log scripts/tolerated-warnings fail |