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
77 changes: 23 additions & 54 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ jobs:

build:
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -el {0}

steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -71,68 +75,35 @@ 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
run: |
pixi run conda-build
mkdir -p /tmp/local-channel/noarch
cp *.conda /tmp/local-channel/noarch/

- name: Verify Conda Package
uses: neutrons/conda-verify@v0.1.2
with:
python-version: "3.11"
local-channel: /tmp/local-channel
module-name: ${{ env.PKG_NAME }}
package-name: ${{ env.PKG_NAME }}
extra-channels: neutrons mantid
extra-commands: |
python -c "import lr_reduction"
python -c "import lr_autoreduce"
python -c "import mantid"

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

conda-verify:
needs: build
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout
uses: actions/checkout@v6
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.11

- name: Download conda package artifact
uses: actions/download-artifact@v7
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 --yes -c /tmp/local-channel -c mantid -c neutrons -c conda-forge ${{ env.PKG_NAME }}

- name: Verify the installation
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:
runs-on: ubuntu-24.04
needs: [tests, build, conda-verify]
needs: [tests, build]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
Expand All @@ -144,8 +115,6 @@ jobs:

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

- name: Download conda package artifact
uses: actions/download-artifact@v7
Expand All @@ -166,7 +135,7 @@ jobs:
# Trigger GitLab dev deploy pipeline
deploy-dev:
runs-on: ubuntu-latest
needs: build
needs: [tests, build]
if: github.ref == 'refs/heads/next'
steps:
- name: Get Environment Name
Expand Down
5 changes: 2 additions & 3 deletions pixi.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ name = "lr_reduction"
version = "0.0.0" # a placeholder overwritten when Pixi task "sync-version" is executed

[tool.pixi.package.build]
backend = { name = "pixi-build-python", version = "0.1.*" }
backend = { name = "pixi-build-python", version = ">=0.2,<1" }

[tool.pixi.package.host-dependencies]
hatchling= ">=1.27.0,<2"
Expand Down
Empty file added src/lr_autoreduce/__init__.py
Empty file.