diff --git a/.github/actions/publish-pypi-package/action.yml b/.github/actions/publish-pypi-package/action.yml index 43ce82af..9936365e 100644 --- a/.github/actions/publish-pypi-package/action.yml +++ b/.github/actions/publish-pypi-package/action.yml @@ -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/* diff --git a/.github/workflows/deploy_conda_nightly.yml b/.github/workflows/deploy_conda_nightly.yml index 60bc15d0..24990274 100644 --- a/.github/workflows/deploy_conda_nightly.yml +++ b/.github/workflows/deploy_conda_nightly.yml @@ -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/setup-miniconda@v2.2.0 diff --git a/conda/meta.yaml b/conda/meta.yaml index b0492cbe..680e6164 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -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