Skip to content

Commit

Permalink
84 Add a devShell with gcc environment
Browse files Browse the repository at this point in the history
This is primarily useful for running a gcc environment on GHA, in
addition to the clang environments we were already running.

So we now run a matrix of [clang, gcc] x [ Linux, Darwin ]

The gcc-Linux is an allowed failure (for now) because the client side
tests fail. An issue has been opened to address this.

These shells can also be useful to users who explicitly want to use gcc
rather than clang.

1. `nix develop path/to/flake`
2. `nix develop path/to/flake#clang`
3. `nix develop path/to/flake#gcc`

1 & 2 give a clang environment; 3 gives a gcc environment.
  • Loading branch information
jacg committed Aug 17, 2023
2 parents e0b65d8 + 5456860 commit 99de86a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ jobs:
)

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow-fail }}
#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]
allow-fail: [false]
devshell: [ clang, gcc ]
#allow-fail: [false]

steps:
- uses: actions/checkout@v3.5.3
Expand All @@ -46,19 +48,20 @@ jobs:
run: nix develop

- name: Test nain4
run: nix develop -c just test-nain4
run: nix develop .#${{ matrix.devshell }} -c just test-nain4

- name: nix-shell
run: nix-shell --run just
if: ${{ matrix.devshell == 'clang' }}

- name: Run client-side tests
run: nix develop -c just test-client-side
run: nix develop .#${{ matrix.devshell }} -c just test-client-side

- name: Run compile-time tests
run: nix develop -c just test-compile-time
run: nix develop .#${{ matrix.devshell }} -c just test-compile-time

- name: Run nain4 examples
run: nix develop -c just test-examples
run: nix develop .#${{ matrix.devshell }} -c just test-examples

- name: Run G4 examples
run: nix develop -c just g4-examples/run-examples-that-work
run: nix develop .#${{ matrix.devshell }} -c just g4-examples/run-examples-that-work
21 changes: 16 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
geant4.data.G4SAIDDATA
geant4.data.G4PARTICLEXS
geant4.data.G4NDL
clang_16
clang-tools
cmake
cmake-language-server
catch2_3
Expand All @@ -61,10 +59,21 @@
] ++ lib.optionals stdenv.isLinux [
];

in {
in rec {

devShell = pkgs.mkShell.override { stdenv = pkgs.clang_16.stdenv; } {
name = "G4-examples-devenv";
devShells.clang = pkgs.mkShell.override { stdenv = pkgs.clang_16.stdenv; } {
name = "nain4-clang-devenv";

packages = my-packages ++ [ clang_16 pkgs.clang-tools ];

G4_DIR = "${pkgs.geant4}";
G4_EXAMPLES_DIR = "${pkgs.geant4}/share/Geant4-11.0.4/examples/";
QT_QPA_PLATFORM_PLUGIN_PATH="${pkgs.libsForQt5.qt5.qtbase.bin}/lib/qt-${pkgs.libsForQt5.qt5.qtbase.version}/plugins";

};

devShells.gcc = pkgs.mkShell {
name = "nain4-gcc-devenv";

packages = my-packages;

Expand All @@ -74,6 +83,8 @@

};

devShell = devShells.clang;

packages.geant4 = my-geant4;
packages.default = my-geant4;

Expand Down

0 comments on commit 99de86a

Please sign in to comment.