Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup dummy X server for CI tests #201

Merged
merged 6 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,59 @@ concurrency:
jobs:

test_on_linux:
name: Test on Linux containers (Ubuntu LTS)
name: Test on remage image
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# guideline: only test on latest patch releases (and maybe previous one)
container_version:
- G4.11.3
- G4.11.2
- G4.11.1
- G4.11.0
- slim

container: docker://gipert/remage-base:${{ matrix.container_version }}

steps:
- uses: actions/checkout@v4
- name: Install pip dependencies for tests
# TODO: replace with a better way to manage test dependencies.
run: |
pip3 install --user --upgrade legend-pydataobj scipy

- name: Build project
run: |
mkdir build
cd build
cmake -DRMG_BUILD_EXAMPLES=1 ..
make
make install

- name: Setup and start xvfb (enables Geant4 visualization)
run: |
Xvfb :99 -screen 0 1920x1080x24 &

- name: Run full test suite
if: ${{ matrix.container_version != 'slim' }}
env:
DISPLAY: :99
run: |
cd build
ctest --output-on-failure --label-exclude 'vis'
ctest --output-on-failure

- name: Upload test suite outputs to GitHub
if: ${{ matrix.container_version != 'slim' }}
uses: actions/upload-artifact@v4
with:
name: test-output-${{ matrix.container_version }}
# artifacts must have a ".output*" extension
path: build/tests/**/*.output*.*

- name: Run minimal test suite
if: ${{ matrix.container_version == 'slim' }}
env:
DISPLAY: :99
run: |
cd build
ctest --output-on-failure --label-exclude 'extra|vis'

- name: Compare checked-in doc dump with current result
if: ${{ matrix.container_version != 'slim' }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion tests/basics/macros/vis-2nbb.mac
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

/run/beamOn 100

/vis/ogl/export vis-2nbb.pdf
/vis/ogl/export vis-2nbb.output.pdf
2 changes: 1 addition & 1 deletion tests/basics/macros/vis-co60.mac
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

/run/beamOn 100

/vis/ogl/export vis-co60.pdf
/vis/ogl/export vis-co60.output.pdf
2 changes: 1 addition & 1 deletion tests/confinement/macros/_init.mac
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/run/initialize

/RMG/Manager/Logging/LogLevel debug
/RMG/Manager/Logging/LogLevel summary
2 changes: 1 addition & 1 deletion tests/confinement/macros/_vis.mac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/run/initialize

/RMG/Manager/Logging/LogLevel debug
/RMG/Manager/Logging/LogLevel summary

/vis/open OGL
/vis/drawVolume
Expand Down
2 changes: 1 addition & 1 deletion tests/confinement/macros/complex-volume.mac
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

/run/beamOn 5000

/control/alias export-fn complex-volume.pdf
/control/alias export-fn complex-volume.output.pdf
2 changes: 1 addition & 1 deletion tests/confinement/macros/geometrical-and-physical.mac
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@

/run/beamOn 2000

/control/alias export-fn geometrical-and-physical.pdf
/control/alias export-fn geometrical-and-physical.output.pdf
2 changes: 1 addition & 1 deletion tests/confinement/macros/geometrical-or-physical.mac
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

/run/beamOn 2000

/control/alias export-fn geometrical-or-physical.pdf
/control/alias export-fn geometrical-or-physical.output.pdf
2 changes: 1 addition & 1 deletion tests/confinement/macros/geometrical.mac
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@

/run/beamOn 5000

/control/alias export-fn geometrical.pdf
/control/alias export-fn geometrical.output.pdf
2 changes: 1 addition & 1 deletion tests/confinement/macros/native-surface.mac
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

/run/beamOn 2000

/control/alias export-fn native-surface.pdf
/control/alias export-fn native-surface.output.pdf
2 changes: 1 addition & 1 deletion tests/confinement/macros/native-volume.mac
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

/run/beamOn 2000

/control/alias export-fn native-volume.pdf
/control/alias export-fn native-volume.output.pdf
Loading