test-essncrystaldev-long #262
This file contains hidden or 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: test-essncrystaldev-long | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: '30 8 * * 2' # 8:30 every Tuesday | |
| workflow_dispatch: | |
| inputs: | |
| manual-debugging: | |
| type: boolean | |
| description: Launch manual debugging tmate session on failure | |
| default: false | |
| jobs: | |
| build: | |
| strategy: | |
| #fail-fast: false | |
| matrix: | |
| include: | |
| - { os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.12' } | |
| - { os: macos-latest, CC: clang, CXX: clang++, python: "3.11" } | |
| name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| env: | |
| CC: ${{ matrix.CC }} | |
| CXX: ${{ matrix.CXX }} | |
| CONDA_SOLVER: libmamba | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ./src_co | |
| - name: Checkout mctools/ncrystal | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: mctools/ncrystal | |
| path: ./src_ncrystal | |
| - name: Checkout project repo | |
| env: # Or as an environment variable | |
| THEACCESSTOKEN: ${{ secrets.ACCESS_TOKEN_NCRYSTALDEV }} | |
| run: | | |
| set -eu | |
| test "${THEACCESSTOKEN:-}" != "" || ( echo "Access token missing"; exit 1 ) | |
| git clone --depth=1 'https://usernamedoesnotmatter:'"${THEACCESSTOKEN}"'@git.esss.dk/ncrystal/ncrystaldev.git' ./src_testproject | |
| - name: Setup conda environment | |
| uses: ./src_co/.github/actions/setup | |
| with: | |
| PYTHON_VERSION: ${{ matrix.python }} | |
| CACHED_NOARCH_DEF_PY_FILE: ./src_co/.github/resources/cached_noarch_definitions.py | |
| CONDA_ENV_FILE : ./src_co/.github/resources/conda-setup.yml | |
| #NCrystal needs extra packages: | |
| - name: Install extra conda pkgs | |
| run: conda env update --name simplebuild_dgcode --file ./src_ncrystal/devel/reqs/conda_all_and_devel.yml | |
| - name: Install pymatgen conda pkg | |
| run: conda install --name simplebuild_dgcode pymatgen | |
| - name: Install | |
| run: | | |
| set -eu | |
| #For dev work: python3 -m pip install git+https://github.com/mctools/simplebuild@whateverbranchname | |
| #For dev work: python3 -m pip install --no-deps ./src_co | |
| python3 -m pip install --no-deps ./src_co | |
| echo "sb --version: "$(sb --version) | |
| - name: Make ncrystaldynamic bundle discoverable | |
| run: pip install -e ./src_ncrystal/devel/simplebuild/discovery | |
| - name: Build (release mode) | |
| id: build-release-mode | |
| run: | | |
| set -eu | |
| cd src_testproject | |
| sb | |
| - name: Launch unit tests (release mode) | |
| id: test-release-mode | |
| run: | | |
| set -eu | |
| cd src_testproject | |
| export tmp='sb_nclong*' | |
| if [ "$RUNNER_OS" == "macOS" ]; then | |
| #Disable a few specific tests on macos until | |
| #https://github.com/mctools/ncrystal/issues/167 is resolved. | |
| export tmp="${tmp}"',!sb_nclongextratests_testdosplot' | |
| export tmp="${tmp}"',!sb_nclongextratests_testplots2' | |
| export tmp="${tmp}"',!sb_nclongtests_testloadvdos' | |
| export tmp="${tmp}"',!sb_nclongtests_testrange' | |
| export tmp="${tmp}"',!sb_nclongtests_vdosloaddbg' | |
| fi | |
| echo "Using --testfilter=${tmp}" | |
| set -x | |
| sb -t -j4 --testexcerpts=100 --requirepkg='NCLongExtraTests,NCLongG4Tests,NCLongTests' --testfilter="${tmp}" | |
| - name: Setup tmate session for manual debugging | |
| uses: mxschmitt/action-tmate@v3 | |
| if: always() && inputs.manual-debugging == true && (steps.build-and-test-core-only.outcome != 'success' || steps.build-and-test-release-mode.outcome != 'success' || steps.build-and-test-debug-mode.outcome != 'success') | |
| with: | |
| limit-access-to-actor: true |