Skip to content
Draft
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
48 changes: 0 additions & 48 deletions .buildconfig/ci-linux.yml

This file was deleted.

143 changes: 98 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,126 @@ on:
- release
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
PIXI_FROZEN: true

jobs:
formatting:
name: Formatting and static analysis
runs-on: 'ubuntu-24.04'
outputs:
min_python: ${{ steps.vars.outputs.min_python }}
min_tox_env: ${{ steps.vars.outputs.min_tox_env }}
steps:
- uses: actions/checkout@v6
- name: Get Python version for other CI jobs
id: vars
run: |
echo "min_python=$(< .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT"
echo "min_tox_env=py$(sed 's/\.//g' < .github/workflows/python-version-ci)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-python@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
python-version-file: '.github/workflows/python-version-ci'
- uses: pre-commit/action@v3.0.1
persist-credentials: false
- uses: prefix-dev/setup-pixi@f00437f565399d418b0acc85936d12c1fb668347 # v0.10.1
with:
extra_args: --all-files
- uses: pre-commit-ci/lite-action@v1.1.0
pixi-version: v0.77.0
environments: lint
locked: true
- run: pixi run -e lint lint
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
if: always()
with:
msg: Apply automatic formatting

tests:
name: Tests
name: ${{ matrix.name }}
needs: formatting
strategy:
fail-fast: false
matrix:
os: ['ubuntu-24.04']
python:
- version: '${{needs.formatting.outputs.min_python}}'
tox-env: '${{needs.formatting.outputs.min_tox_env}}'
uses: ./.github/workflows/test.yml
with:
os-variant: ${{ matrix.os }}
python-version: ${{ matrix.python.version }}
tox-env: ${{ matrix.python.tox-env }}
secrets: inherit
include:
- name: Tests (ubuntu-24.04, 3.12, py312) / test
os: 'ubuntu-24.04'
environment: default
task: test
# Mantid is not available for win-64, see the comment in pixi.toml.
- name: Mantid tests
os: 'ubuntu-24.04'
environment: mantid
task: test-mantid
- name: Tests (macOS)
os: 'macos-latest'
environment: default
task: test
- name: Tests (Windows)
os: 'windows-latest'
environment: default
task: test
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # history required so setuptools_scm can determine the version
persist-credentials: false
- uses: prefix-dev/setup-pixi@f00437f565399d418b0acc85936d12c1fb668347 # v0.10.1
with:
pixi-version: v0.77.0
environments: ${{ matrix.environment }}
locked: true
- run: pixi run -e ${{ matrix.environment }} ${{ matrix.task }}
env:
ESS_PROTECTED_FILESTORE_USERNAME: ${{ secrets.ESS_PROTECTED_FILESTORE_USERNAME }}
ESS_PROTECTED_FILESTORE_PASSWORD: ${{ secrets.ESS_PROTECTED_FILESTORE_PASSWORD }}

sqw:
name: SQW/Horace tests
needs: formatting
runs-on: 'ubuntu-24.04'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # history required so setuptools_scm can determine the version
persist-credentials: false
# Horace compatibility tests need both pace_neutrons and a MATLAB runtime.
# Keep them in a dedicated environment so missing MATLAB cannot turn the
# regular test job into a green run with silently skipped integration tests.
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@2323adb8243827ea460b0def4c413545aaec46a9 # v3.0.2
with:
cache: true
products: "MATLAB_Compiler_SDK"
- uses: prefix-dev/setup-pixi@f00437f565399d418b0acc85936d12c1fb668347 # v0.10.1
with:
pixi-version: v0.77.0
environments: sqw
locked: true
- run: pixi run -e sqw test-sqw

mantid:
name: Mantid tests
package:
name: Tests (ubuntu-24.04, 3.12, py312) / package-test
needs: formatting
runs-on: 'ubuntu-22.04'
defaults:
run:
shell: bash -l {0} # required for conda env
runs-on: 'ubuntu-24.04'
steps:
- uses: actions/checkout@v4
- name: Setup conda environment
uses: mamba-org/setup-micromamba@v2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
micromamba-version: 2.0.4-0
environment-file: .buildconfig/ci-linux.yml
cache-environment: true
create-args: >-
python=3.12
conda-build
- run: conda develop src
- run: python -m pytest tests/mantid_*
fetch-depth: 0 # history required so setuptools_scm can determine the version
persist-credentials: false
# Deliberately does not use pixi: this checks the actual wheel through the
# same plain pip installation path used by package consumers.
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: '.github/workflows/python-version-ci'
- run: python -m pip install build
- run: python -m build --wheel
- run: python -m pip install dist/*.whl
- run: python "${{ github.workspace }}/tests/package_test.py"
working-directory: ${{ runner.temp }}

docs:
needs: [tests, mantid]
needs: [tests, sqw, package]
uses: ./.github/workflows/docs.yml
with:
publish: false
linkcheck: ${{ github.ref == 'refs/heads/main' }}
branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }}
secrets: inherit
branch: ${{ github.event.pull_request.head.sha || github.sha }}
secrets:
ESS_PROTECTED_FILESTORE_USERNAME: ${{ secrets.ESS_PROTECTED_FILESTORE_USERNAME }}
ESS_PROTECTED_FILESTORE_PASSWORD: ${{ secrets.ESS_PROTECTED_FILESTORE_PASSWORD }}
Loading