From 91713c804cfec8a72343d53f6879085df85a151e Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Thu, 2 May 2024 13:11:05 +0200 Subject: [PATCH 1/8] Disable all tests except ubuntu latest --- .github/workflows/build-neuron.yml | 66 +----------------------------- 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/.github/workflows/build-neuron.yml b/.github/workflows/build-neuron.yml index 5d85844..4ec6570 100644 --- a/.github/workflows/build-neuron.yml +++ b/.github/workflows/build-neuron.yml @@ -21,55 +21,12 @@ defaults: shell: bash jobs: - # This allows us to dynamically vary the number of branches we run on on - # different days. - provide_version_matrix: - runs-on: ubuntu-latest - steps: - - name: check Azure drop url exists -> ${{ github.event.inputs.azure_drop_url }} - if: github.event_name == 'workflow_dispatch' && github.event.inputs.azure_drop_url - run: | - curl -sfSI -X GET '${{ github.event.inputs.azure_drop_url }}' - - name: Get latest release information - id: get_latest_release - uses: joutvhu/get-release@v1 - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - debug: true - latest: true - prerelease: true - repo: "nrn" - - name: Construct matrix of branch/tag names and wheel versions to test - id: provide_versions - run: | - if [[ '${{github.event.inputs.neuron_branch}}' == "" ]] - then - # If we're not told to test a specific branch, test the default branch with neuron-nightly wheels - values="{\"branch_or_tag\": \"\", \"default_wheel\": \"neuron-nightly\"}" - if [[ $(date +%u) == 1 ]] || [[ ${{ github.event_name }} == 'pull_request' ]] || [[ ${{ github.event_name }} == 'push' ]] - then - # If it's a Monday, test the latest release (and latest released wheels) in addition - # Also test it on any PR, and any push to a PR - tag_name="${{steps.get_latest_release.outputs.tag_name}}" - values="${values}, {\"branch_or_tag\": \"${tag_name}\", \"default_wheel\": \"neuron==${tag_name}\"}" - fi - echo "matrix=[${values}]" >> $GITHUB_OUTPUT - else - # Test the given branch with no wheels by default. If an Azure URL is given, those wheels will be used. - echo "matrix=[{\"branch_or_tag\": \"${{github.event.inputs.neuron_branch}}\", \"default_wheel\": \"\"}]" >> $GITHUB_OUTPUT - fi - outputs: - matrix: ${{ steps.provide_versions.outputs.matrix }} - ci: timeout-minutes: 45 - needs: provide_version_matrix runs-on: ${{ matrix.os.vm }} container: ${{ matrix.os.container }} - name: ${{matrix.os.container || matrix.os.vm}} ${{matrix.branch_or_tag_and_default_wheel.branch_or_tag}} ${{matrix.branch_or_tag_and_default_wheel.default_wheel}} + name: "blabla" env: - SDK_ROOT: $(xcrun --sdk macosx --show-sdk-path) OS_FLAVOUR: ${{matrix.os.flavour}} UNPRIVILEGED_USER: runner # User created+used inside Docker containers # Extra software collections to be installed and enabled on CentOS7 @@ -78,29 +35,8 @@ jobs: strategy: matrix: os: - # GitHub Actions MacOS 13 runner - - { vm: macos-13, flavour: macOS } - # GitHub Actions MacOS 12 runner - - { vm: macos-12, flavour: macOS } - # CentOS7 Docker image - - { vm: ubuntu-latest, container: "centos:7", flavour: redhat } - # CentOS Stream 8 Docker image - - { vm: ubuntu-latest, container: "quay.io/centos/centos:stream8", flavour: redhat } - # CentOS Stream 9 Docker image - - { vm: ubuntu-latest, container: "quay.io/centos/centos:stream9", flavour: redhat } - # Fedora 37 Docker image - - { vm: ubuntu-latest, container: "fedora:37", flavour: redhat } - # Fedora Latest (38, at time of writing) Docker image - - { vm: ubuntu-latest, container: "fedora:latest", flavour: redhat } - # Ubuntu 20.04 Docker image - - { vm: ubuntu-latest, container: "ubuntu:20.04", flavour: debian } # Ubuntu Latest (22.04, at time of writing) Docker image - { vm: ubuntu-latest, container: "ubuntu:latest", flavour: debian } - # Debian Bullseye (11) Docker image - - { vm: ubuntu-latest, container: "debian:bullseye", flavour: debian } - # At the time of writing, Debian Bookworm (12) Docker image - - { vm: ubuntu-latest, container: "debian:stable", flavour: debian } - branch_or_tag_and_default_wheel: ${{ fromJson(needs.provide_version_matrix.outputs.matrix) }} fail-fast: false steps: From b215eb8b3569771d9576d1351e945fad616d9b0f Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Thu, 2 May 2024 13:38:24 +0200 Subject: [PATCH 2/8] Only run the single test that fails --- scripts/buildNeuron.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildNeuron.sh b/scripts/buildNeuron.sh index 77e96b5..ec4d2b8 100755 --- a/scripts/buildNeuron.sh +++ b/scripts/buildNeuron.sh @@ -78,4 +78,4 @@ echo "------- Install NEURON -------" cmake --build . -- install echo "------- Run test suite -------" -ctest -VV -j ${PARALLEL_JOBS} +ctest -VV -j ${PARALLEL_JOBS} -R 'rxdmod_tests::rxd_tests' From 8d629c975179e9ee3311dc5d6d818198b6f1c166 Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Thu, 2 May 2024 14:48:56 +0200 Subject: [PATCH 3/8] Be more specific about the test --- scripts/buildNeuron.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildNeuron.sh b/scripts/buildNeuron.sh index ec4d2b8..959521f 100755 --- a/scripts/buildNeuron.sh +++ b/scripts/buildNeuron.sh @@ -78,4 +78,4 @@ echo "------- Install NEURON -------" cmake --build . -- install echo "------- Run test suite -------" -ctest -VV -j ${PARALLEL_JOBS} -R 'rxdmod_tests::rxd_tests' +ctest -VV -j ${PARALLEL_JOBS} -R 'test_multi_gridding_mix' From 0c49c67669be0ab59c0e81cb7b028dd1ea4b4215 Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Fri, 3 May 2024 10:18:37 +0200 Subject: [PATCH 4/8] Revert "Be more specific about the test" This reverts commit 8d629c975179e9ee3311dc5d6d818198b6f1c166. --- scripts/buildNeuron.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildNeuron.sh b/scripts/buildNeuron.sh index 959521f..ec4d2b8 100755 --- a/scripts/buildNeuron.sh +++ b/scripts/buildNeuron.sh @@ -78,4 +78,4 @@ echo "------- Install NEURON -------" cmake --build . -- install echo "------- Run test suite -------" -ctest -VV -j ${PARALLEL_JOBS} -R 'test_multi_gridding_mix' +ctest -VV -j ${PARALLEL_JOBS} -R 'rxdmod_tests::rxd_tests' From 4c1daf60550b3fa215fd5b415f5c29e3ada92bb1 Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Fri, 3 May 2024 10:40:11 +0200 Subject: [PATCH 5/8] Enable tmate on failure --- .github/workflows/build-neuron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-neuron.yml b/.github/workflows/build-neuron.yml index 4ec6570..0e4f9c1 100644 --- a/.github/workflows/build-neuron.yml +++ b/.github/workflows/build-neuron.yml @@ -118,5 +118,5 @@ jobs: # This step will set up an SSH connection on tmate.io for live debugging # of non-Docker runs that failed. - name: live debug session on failure - if: failure() && !matrix.os.container + if: failure() uses: mxschmitt/action-tmate@v3 From 1fc5aeaff46001816ef50dd43f2bc8196735d22e Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Thu, 19 Sep 2024 14:52:22 +0200 Subject: [PATCH 6/8] Test again --- .github/workflows/build-neuron.yml | 47 +++--------------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build-neuron.yml b/.github/workflows/build-neuron.yml index 0e4f9c1..3794f10 100644 --- a/.github/workflows/build-neuron.yml +++ b/.github/workflows/build-neuron.yml @@ -77,46 +77,7 @@ jobs: git clone --depth=1 --single-branch ${BRANCH_OPT} ${{github.server_url}}/${{github.repository_owner}}/nrn # Init submodules for testing purposes cd nrn && git submodule update --init --recursive - - # When we run in Ubuntu/Fedora/Debian containers from Docker Hub then we - # are root. This is different from when we use the GitHub Actions images - # directly, and leads to errors from MPI later. If we run inside Docker, - # create a regular user to run as. - - name: Setup unprivileged user - # If we run in a native GitHub Actions container, without Docker, this - # isn't needed - if: matrix.os.container - run: | - useradd --create-home ${UNPRIVILEGED_USER} - chown -R ${UNPRIVILEGED_USER}:${UNPRIVILEGED_USER} ${GITHUB_WORKSPACE} - - # Put all the remaining steps in one job that runs as an unprivileged user - - name: Build and test NEURON - working-directory: ${{github.workspace}}/nrn - run: ../wrappers/runUnprivileged.sh ../scripts/buildNeuron.sh - env: - INSTALL_DIR : ${{github.workspace}}/nrn/install - - # Download specific wheels from Azure via workflow dispatch - - name: Download Azure drop (artifacts) -> ${{ github.event.inputs.azure_drop_url }} - if: github.event.inputs.azure_drop_url - working-directory: ${{github.workspace}} - run: ./scripts/getAzureDrop.sh '${{ github.event.inputs.azure_drop_url }}' - - # Test the wheels. If an Azure URL was given, those wheels are used. Otherwise: - # - default branch (master): neuron-nightly - # - latest release (tag X.Y): neuron==X.Y - # - feature branch: wheels only tested if a URL is given - - name: Test (nightly) NEURON wheel - if: github.event.inputs.azure_drop_url || matrix.branch_or_tag_and_default_wheel.default_wheel - working-directory: ${{github.workspace}}/nrn - run: ../wrappers/runUnprivileged.sh ../scripts/testNeuronWheel.sh - env: - NRN_PACKAGE: ${{matrix.branch_or_tag_and_default_wheel.default_wheel}} - NEURON_BRANCH_OR_TAG: ${{matrix.branch_or_tag}} - - # This step will set up an SSH connection on tmate.io for live debugging - # of non-Docker runs that failed. - - name: live debug session on failure - if: failure() - uses: mxschmitt/action-tmate@v3 + python -m venv env + source env/bin/activate + env/bin/python -m pip install neuron-nightly pytest + env/bin/python -m pytest -k test_multi_gridding_mix From 6c231e00516ebde8ff3d7b5698e6d6cedfabcb8f Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Thu, 19 Sep 2024 14:55:51 +0200 Subject: [PATCH 7/8] Whoops typo --- .github/workflows/build-neuron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-neuron.yml b/.github/workflows/build-neuron.yml index 3794f10..d269347 100644 --- a/.github/workflows/build-neuron.yml +++ b/.github/workflows/build-neuron.yml @@ -77,7 +77,7 @@ jobs: git clone --depth=1 --single-branch ${BRANCH_OPT} ${{github.server_url}}/${{github.repository_owner}}/nrn # Init submodules for testing purposes cd nrn && git submodule update --init --recursive - python -m venv env + python3 -m venv env source env/bin/activate env/bin/python -m pip install neuron-nightly pytest env/bin/python -m pytest -k test_multi_gridding_mix From 0962bcdbb5f40cb349347084e699aecbcdb1ad6d Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Thu, 19 Sep 2024 15:01:00 +0200 Subject: [PATCH 8/8] Specify dir --- .github/workflows/build-neuron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-neuron.yml b/.github/workflows/build-neuron.yml index d269347..0062da2 100644 --- a/.github/workflows/build-neuron.yml +++ b/.github/workflows/build-neuron.yml @@ -80,4 +80,4 @@ jobs: python3 -m venv env source env/bin/activate env/bin/python -m pip install neuron-nightly pytest - env/bin/python -m pytest -k test_multi_gridding_mix + env/bin/python -m pytest -k test_multi_gridding_mix test/