Merge pull request #183 from neutrons/multi_group_out #586
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: mantid_total_scattering_ci | |
env: | |
PYTHON_MAIN_VERSION: 3.10 | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [next] | |
tags: ['v*'] | |
jobs: | |
linux: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge,mantid/label/nightly,oncat | |
- name: Conda install deps | |
shell: bash -l {0} | |
run: | | |
conda install mantidworkbench | |
conda install --file requirements-conda.txt --file requirements-dev-conda.txt | |
pip install tox-gh-actions==2.12.0 | |
- name: Lint with Tox | |
if: ${{ matrix.python-version == env.PYTHON_MAIN_VERSION }} | |
shell: bash -l {0} | |
run: | | |
tox -e lint | |
tox -e lint-security | |
- name: Test with Tox | |
shell: bash -l {0} | |
run: | | |
sudo apt-get install libglu1-mesa | |
tox | |
- name: Coverage - create and upload report | |
shell: bash -l {0} | |
if: ${{ matrix.python-version == env.PYTHON_MAIN_VERSION }} | |
run: | | |
tox -e coverage | |
pip install coverage | |
bash <(curl -s https://codecov.io/bash) | |
- name: Build conda package | |
shell: bash -l {0} | |
run: | | |
cd conda.recipe/mantid-total-scattering | |
conda mambabuild --output-folder . -c neutrons -c oncat . | |
- name: Deploy full package to Anaconda | |
shell: bash -l {0} | |
if: startsWith( github.ref, 'refs/tags/v') | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
IS_RC: ${{ contains(github.ref, 'rc') }} | |
run: | | |
CONDA_LABEL="main" | |
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi | |
cd conda.recipe/mantid-total-scattering | |
anaconda upload --label $CONDA_LABEL linux-64/*.tar.bz2 | |
- name: Deploy python wrapper to Anaconda | |
shell: bash -l {0} | |
if: startsWith( github.ref, 'refs/tags/v') | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
IS_RC: ${{ contains(github.ref, 'rc') }} | |
run: | | |
conda install -y anaconda-client conda-build conda-verify | |
cd conda.recipe/mantid-total-scattering-python-wrapper | |
conda build --output-folder . . | |
CONDA_LABEL="main" | |
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi | |
anaconda upload --label $CONDA_LABEL noarch/*.tar.bz2 | |
trigger-deploy: | |
runs-on: ubuntu-22.04 | |
needs: [linux] | |
# only trigger deploys from protected branches and tags | |
# if: ${{ github.ref_protected || github.ref_type == 'tag' }} | |
if: false | |
steps: | |
- name: Determine Environment | |
uses: neutrons/branch-mapper@v2 | |
id: conda_env_name | |
with: | |
prefix: mantidtotalscattering | |
- 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 }} |