-
Notifications
You must be signed in to change notification settings - Fork 2
100 lines (88 loc) · 3.18 KB
/
actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: quicknxs_ci
env:
TRIGGER_URL: "https://code.ornl.gov/api/v4/projects/11852/trigger/pipeline"
on:
workflow_dispatch:
pull_request:
push:
branches: [next]
tags: ['v*']
jobs:
linux:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
outputs:
deploy_enabled: 'false'
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
channels: mantid/label/nightly,conda-forge,defaults
python-version: '3.10'
miniconda-version: latest
mamba-version: "*"
environment-file: environment.yml
- name: Unit test with code coverage
run: |
git submodule update --init
ls -l test/data/reflectivity_ui-data
xvfb-run -a python -m pytest -vv -m "not datarepo" --cov=reflectivity_ui --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }} # required
- name: Build Wheel
run: |
python -m build --wheel --no-isolation
check-wheel-contents dist/reflectivity_ui-*.whl
- name: Build Conda package
run: |
conda mambabuild --output-folder . . -c mantid
conda verify noarch/reflectivity_ui-*.tar.bz2
- name: Deploy to Anaconda
if: startsWith(github.ref, 'refs/tags/v')
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
IS_RC: ${{ contains(github.ref, 'rc') }}
IS_DEV: ${{ github.ref == 'refs/heads/next' }}
run: |
# label is main or rc depending on the tag-name
CONDA_LABEL="main"
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
if [ "${IS_DEV}" = "true" ]; then CONDA_LABEL="dev"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
anaconda upload --label $CONDA_LABEL noarch/reflectivity_ui-*.tar.bz2
trigger-deploy:
runs-on: ubuntu-22.04
needs: [linux]
env:
ENABLE_DEPLOY: 'false'
# only trigger deploys from protected branches
# Disable automatic deployments until DevOps resolves the automatic Conda deployments
if: ${{ (needs.linux.outputs.deploy_enabled == 'true') && (github.ref_protected || github.ref_type == 'tag') }}
steps:
- name: Determine Environment
uses: neutrons/branch-mapper@v2
id: conda_env_name
with:
prefix: quicknxs2
- name: Trigger deploy
# Disable automatic deployments until DevOps resolves the automatic Conda deployments
id: trigger
uses: eic/trigger-gitlab-ci@v2
with:
url: https://code.ornl.gov
token: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
project_id: 11852
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 }}