Skip to content

Commit

Permalink
Run mvesuvio before uploading package
Browse files Browse the repository at this point in the history
During the nightly deployment workflow, it's best to test
the basic functunality of config and make sure that
at least this command does not give an error.

In the case of conda, this is best done in the conda recipe,
by adding a test section that runs the command for config.
(Also added command to run unit tests)
  • Loading branch information
GuiMacielPereira committed Dec 3, 2024
1 parent 379732f commit 0338b1e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/actions/publish-pypi-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,26 @@ runs:
shell: bash -l {0}
run: |
conda config --set always_yes yes --set changeps1 no
conda create -n build-env-pypi python=3.10.*
conda activate build-env-pypi
mamba install -c conda-forge python-build twine
conda create -n build-env-pypi -c conda-forge python=3.10.* python-build twine
- name: Build package
shell: bash -l {0}
run: |
conda activate build-env-pypi
python -m build
conda deactivate
- name: Test basic functunality of mvesuvio
shell: bash -l {0}
run: |
mamba create -n mvesuvio-test
conda activate mvesuvio-test
pip install dist/*.whl
mvesuvio config
conda deactivate
- name: Upload to PyPI
shell: bash -l {0}
run: |
conda activate build-env-pypi
twine upload -u __token__ -p ${{ inputs.token }} dist/*
1 change: 1 addition & 0 deletions .github/workflows/deploy_conda_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- name: Check for changes since last build
run: |
echo "recentCommits=$(test -z $(git log --since="yesterday" -1 --format=%h) && echo false || echo true)" >> $GITHUB_ENV
- name: Setup Miniconda
if: ${{ env.recentCommits == 'true'}}
uses: conda-incubator/[email protected]
Expand Down
9 changes: 9 additions & 0 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ requirements:
test:
imports:
- mvesuvio
requires:
- pytest
- mock
source_files:
- tests/unit/
- tools/
commands:
- pytest
- mvesuvio config

about:
home: https://github.com/mantidproject/vesuvio
Expand Down

0 comments on commit 0338b1e

Please sign in to comment.