Skip to content
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
93 changes: 45 additions & 48 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ on:
pull_request:
push:
branches: [next]
tags: ['v*']
tags: ["v*"]

# cancel previous job if new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PKG_NAME: shiver
Expand All @@ -18,24 +23,22 @@ jobs:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Checkout
uses: actions/checkout@v6

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

- name: Install shiver
run: pixi run python -m pip install -e .
- 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: 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 }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

build:
name: Conda build with Pixi
Expand All @@ -50,8 +53,6 @@ jobs:

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

- name: Build Conda package
run: pixi run conda-build
Expand Down Expand Up @@ -127,8 +128,6 @@ jobs:

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

- name: Download previous conda package artifact
uses: actions/download-artifact@v7
Expand All @@ -154,32 +153,30 @@ jobs:
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 }}
# Trigger GitLab dev deploy pipeline
deploy-dev:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/next'
steps:
- name: Get Environment Name
uses: neutrons/branch-mapper@main
id: env_name
with:
prefix: ${{ env.PKG_NAME }}

- name: Trigger Dev Deploy
# use https://github.com/eic/trigger-gitlab-ci/pull/14 until merged
uses: eic/trigger-gitlab-ci@d984d8d53d871d2fdc1325639d94322da6e8747f
id: trigger
with:
url: https://code.ornl.gov
project_id: 18992
ref_name: main
token: ${{ secrets.GITLAB_DEPLOY_TOKEN }}

- name: Annotate commit
uses: peter-evans/commit-comment@v4
with:
body: |
GitLab pipeline for ${{ steps.env_name.outputs.name }} has been submitted for this commit: ${{ steps.trigger.outputs.web_url }}
25 changes: 13 additions & 12 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 20 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ documentation = "https://neutrons.github.io/Shiver/"
shiver = "shiver.shiver:gui"

[build-system]
requires = [
"hatchling",
"versioningit"
]
requires = ["hatchling", "versioningit"]
build-backend = "hatchling.build"

[tool.hatch.version]
Expand Down Expand Up @@ -58,8 +55,8 @@ line-length = 120
select = ["E", "W", "F", "I"]
# Ignore rules that correspond to pylint's disabled checks
ignore = [
"E501", # Line too long (handled by formatter)
"E721", # Type comparison - existing code pattern with QString
"E501", # Line too long (handled by formatter)
"E721", # Type comparison - existing code pattern with QString
]

[tool.ruff.lint.per-file-ignores]
Expand All @@ -74,22 +71,22 @@ ignore = [
preview = ["pixi-build"] # Need this to access pixi-build feature
platforms = ["linux-64"]
channels = [
"conda-forge",
"mantid-ornl",
"mantid-ornl/label/rc",
"mantid",
"oncat",
"neutrons",
"neutrons/label/rc",
"https://prefix.dev/pixi-build-backends"
"conda-forge",
"mantid-ornl",
"mantid-ornl/label/rc",
"mantid",
"oncat",
"neutrons",
"neutrons/label/rc",
"https://prefix.dev/pixi-build-backends",
]

[tool.pixi.package]
name = "shiver"
version = "0.0.0" # placeholder, can be updated by task sync-version

[tool.pixi.package.build]
backend = { name = "pixi-build-python", version = "0.1.*" }
backend = { name = "pixi-build-python", version = "0.4.*" }

[tool.pixi.package.host-dependencies]
hatchling = "*"
Expand All @@ -98,13 +95,13 @@ versioningit = "*"
[tool.pixi.package.run-dependencies]
#dependencies for the conda package - for shiver to run
mantidworkbench = "==6.14.0.2"
pyoncatqt =">=1.2.1"
pyoncatqt = ">=1.2.1"
configupdater = "*"

[tool.pixi.dependencies]
# Conda package dependencies for the local environment though pixi
mantidworkbench = "==6.14.0.2"
pyoncatqt =">=1.2.1"
pyoncatqt = ">=1.2.1"
configupdater = "*"

[tool.pixi.pypi-dependencies]
Expand All @@ -114,7 +111,12 @@ shiver = { path = ".", editable = true }

[tool.pixi.environments]
#environment definitions with feature dependencies
default = { features = ["package", "developer","docs","test",], solve-group = "default" }
default = { features = [
"package",
"developer",
"docs",
"test",
], solve-group = "default" }

[tool.pixi.feature.package.dependencies]
#conda package
Expand Down