Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6816190
pixi configurations added
mpatrou Jun 30, 2025
beaeee1
pixi environments configurations, environment and meta files remoced,…
mpatrou Jun 30, 2025
f86b0c3
version update
mpatrou Jul 1, 2025
8a8e0df
version update for dev
mpatrou Jul 1, 2025
c467802
hatch confs
mpatrou Jul 1, 2025
01b79c0
setuptools back
mpatrou Jul 1, 2025
6f5c3d0
hatcling regex
mpatrou Jul 1, 2025
040c593
hatchling back
mpatrou Jul 1, 2025
6d3112f
versioning confs, setutools completely removed
mpatrou Jul 1, 2025
0ebb663
distance updates
mpatrou Jul 1, 2025
8042941
pixi lock ignored
mpatrou Jul 1, 2025
2a5f379
pixi lock file added
mpatrou Jul 1, 2025
c1385d5
ci actions with pixi and conda pg installation check
mpatrou Jul 1, 2025
69c4dbe
conda build renaming
mpatrou Jul 1, 2025
f7b1944
build conda command everywhere
mpatrou Jul 1, 2025
a5c46d3
update lockfiles action
mpatrou Jul 1, 2025
4d05079
pixi lock
mpatrou Jul 1, 2025
a152d4b
pylint errors fixed
mpatrou Jul 1, 2025
e453990
pixi lock update
mpatrou Jul 1, 2025
3fb36ba
pixi run added
mpatrou Jul 1, 2025
160d2ea
audit added
mpatrou Jul 1, 2025
8cd758e
conda verify needs package
mpatrou Jul 1, 2025
9efcc56
audit removed
mpatrou Jul 1, 2025
b72c90b
readthedocs changes
mpatrou Jul 1, 2025
18b83be
install
mpatrou Jul 1, 2025
b312812
get package name
mpatrou Jul 1, 2025
b880907
conda pkg extension
mpatrou Jul 1, 2025
9d42995
micromamba installation step
mpatrou Jul 1, 2025
bc8408f
runtimes dependencies added
mpatrou Jul 2, 2025
073a640
dependecies description, conda vreify steps
mpatrou Jul 2, 2025
6f89be2
conda-build installation on CI
mpatrou Jul 2, 2025
802b753
test. yml typos
mpatrou Jul 2, 2025
a80d8cd
mplbackend added in github actions
mpatrou Jul 2, 2025
127d16f
space fixed
mpatrou Jul 2, 2025
d73ea90
readthedocs point to config folder added
mpatrou Jul 2, 2025
02020d3
actions updated with publish step after verify
mpatrou Jul 2, 2025
b08c9bc
comment
mpatrou Jul 2, 2025
37f0cdf
documentation update, keywords, CI actions names
mpatrou Jul 2, 2025
e96c910
documentation update for pixi
mpatrou Jul 2, 2025
94286cc
publish step update path and usage docs
mpatrou Jul 2, 2025
8eb75dc
publish step update checkout
mpatrou Jul 2, 2025
1165e94
include fetcing tags in publish step
mpatrou Jul 2, 2025
b9bad65
job name tests
mpatrou Jul 3, 2025
0bdf97d
changes from comments
mpatrou Jul 3, 2025
1af4381
pixi lock check hook added
mpatrou Jul 3, 2025
3bb00d9
github actions updates for consistency across projects
mpatrou Jul 3, 2025
894fcda
readthedocs conf for os
mpatrou Jul 3, 2025
cacf4fa
typos fixed
mpatrou Jul 3, 2025
4a84be0
channels and other details are back
mpatrou Jul 3, 2025
eea4725
publish setp skipped for untagged commits
mpatrou Jul 3, 2025
705b4e6
extra check removed
mpatrou Jul 3, 2025
c584283
docs, commandsupdates
mpatrou Jul 3, 2025
be52812
typo
mpatrou Jul 3, 2025
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
109 changes: 0 additions & 109 deletions .github/workflows/actions.yml

This file was deleted.

188 changes: 188 additions & 0 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
name: Tests, Package, and Deployment

on:
workflow_dispatch:
pull_request:
push:
branches: [next]
tags: ['v*']

env:
PKG_NAME: shiver

jobs:
tests:
name: Testing Suite
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.10
with:
pixi-version: v0.48.2

- name: pylint
run: pixi run pre-commit run -a pylint

- name: Install shiver
run: pixi run python -m pip install -e .

- name: Run tests
run: pixi run xvfb-run --server-args="-screen 0 1920x1080x24" -a python -m pytest --cov=src --cov-report=xml --cov-report=term

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

build:
name: Conda build with Pixi
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true
ref: ${{ github.ref }}

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.10
with:
pixi-version: v0.48.2

- name: Build Conda package
run: pixi run conda-build

- name: upload conda package as artifact
uses: actions/upload-artifact@v4
with:
name: artifact-conda-package
path: ${{ env.PKG_NAME }}-*.conda

conda-verify:
name: Conda Verify
needs: build
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.ref }}

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: test
init-shell: bash
create-args: >-
python=3.10

- name: Download conda package artifact
uses: actions/download-artifact@v4
with:
name: artifact-conda-package
path: /tmp/local-channel/linux-64

- name: Install the package
run: |
micromamba install --yes -c conda-forge conda-build conda-index
python -m conda_index /tmp/local-channel
micromamba install -c /tmp/local-channel -c conda-forge -c mantid-ornl -c mantid -c neutrons -c oncat ${{ env.PKG_NAME }}

- name: Verify the installation
env:
MPLBACKEND: Agg
run: |
conda_version=$(micromamba list "${{ env.PKG_NAME }}" | awk -v pkg="${{ env.PKG_NAME }}" '$1 == pkg { print $2 }')
echo "Conda version: $conda_version"
python_version=$(python -c "import ${{ env.PKG_NAME }}; print(${{ env.PKG_NAME }}.__version__)")
echo "Python version: $python_version"
if [ "$conda_version" != "$python_version" ]; then
echo "Version mismatch!"
exit 1
else
echo "Versions match."
fi

publish:
name: Publish
runs-on: ubuntu-24.04
needs: [tests, conda-verify]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
fetch-tags: true
ref: ${{ github.ref }}

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.10
with:
pixi-version: v0.48.2

- name: Download previous conda package artifact
uses: actions/download-artifact@v4
with:
name: artifact-conda-package

- name: Get artifact conda package filename
run: |
echo "Files downloaded:"
ls
# Get the first file
FILE_NAME=$(ls ./shiver-*.conda)
echo "Conda package file to publish: $FILE_NAME"

- name: Upload package to anaconda
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
IS_RC: ${{ contains(github.ref, 'rc') }}
run: |
# label is main or rc depending on the tag-name
CONDA_LABEL="main"
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
pixi run anaconda upload --label $CONDA_LABEL --user neutrons ${{ env.PKG_NAME }}-*.conda

# trigger-deploy:
# runs-on: ubuntu-22.04
# needs: [tests, conda-build]
# # only trigger deploys from protected branches and tags
# if: ${{ github.ref_protected || github.ref_type == 'tag' }}
# steps:
# - name: Determine Environment
# uses: neutrons/branch-mapper@v2
# id: conda_env_name
# with:
# prefix: shiver

# - name: Trigger deploy
# id: trigger
# uses: eic/trigger-gitlab-ci@v2
# with:
# url: https://code.ornl.gov
# token: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
# project_id: 7835
# ref_name: main
# variables: |
# PLAY="update"
# CONDA_ENV="${{ steps.conda_env_name.outputs.name }}"

# - name: Annotate commit
# uses: peter-evans/commit-comment@v2
# with:
# body: |
# GitLab pipeline for ${{ steps.conda_env_name.outputs.name }} has been submitted for this commit: ${{ steps.trigger.outputs.web_url }}
36 changes: 36 additions & 0 deletions .github/workflows/update-lockfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update lockfiles

permissions:
contents: write
pull-requests: write

on:
workflow_dispatch:
schedule:
- cron: 0 5 1 * *

jobs:
pixi-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.8.10
with:
run-install: false
- name: Update lockfiles
run: |
set -o pipefail
pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update pixi lockfile
title: Update pixi lockfile
body-path: diff.md
branch: update-pixi
base: next # change this to the default branch of your repository
labels: pixi
delete-branch: true
add-paths: pixi.lock
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ dmypy.json

src/shiver/_version.py
.vscode/launch.json
# pixi environments
.pixi
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: "DGS_SC_scripts/.*|.*\\.mat$"

ci:
skip: [pylint]
skip: [pylint, pixi-lock-check]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -25,6 +25,7 @@ repos:
rev: v2.4.1
hooks:
- id: codespell
exclude: pixi.lock
- repo: local
hooks:
- id: pylint
Expand All @@ -37,3 +38,8 @@ repos:
"-rn", # Only display messages
"-sn", # Don't display the score
]
- id: pixi-lock-check
name: pixi-lock-check
entry: bash -c "pixi lock --check"
stage: pre-push
language: system
27 changes: 12 additions & 15 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "mambaforge-4.10"

python:
install:
- method: pip
path: .

sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true

conda:
environment: environment.yml
python: "3.11"
jobs:
create_environment:
- asdf plugin add pixi
- asdf install pixi latest
- asdf global pixi latest
install:
- pixi install
build:
html:
- pixi run sphinx-build -T -b html docs/source $READTHEDOCS_OUTPUT/html
Loading