-
Notifications
You must be signed in to change notification settings - Fork 4
124 lines (108 loc) · 4 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: addie_ci
env:
TRIGGER_URL: "https://code.ornl.gov/api/v4/projects/5749/trigger/pipeline"
on:
workflow_dispatch:
pull_request:
push:
branches: [next]
tags: ['v*']
jobs:
linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniforge-version: latest
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
- name: Apt install deps
run: |
sudo apt update
sudo apt-get install xvfb freeglut3-dev libglu1-mesa
- name: Mantid pre-requisites
shell: bash -l {0}
run: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
mkdir ~/.mantid
echo "CheckMantidVersion.OnStartup=0" > ~/.mantid/Mantid.user.properties
echo "UpdateInstrumentDefinitions.OnStartup=0" >> ~/.mantid/Mantid.user.properties
echo "usagereports.enabled=0" >> ~/.mantid/Mantid.user.properties
export DISPLAY=:99.0
sleep 3
- name: Lint
shell: bash -l {0}
run: flake8 . --count
- name: Test
shell: bash -l {0}
run: |
python -c "import mantid"
python -c "import qtpy"
python -c "import mantidqt"
xvfb-run --server-args="-screen 0 640x480x24" --auto-servernum mantidworkbench --help
echo "import time;time.sleep(5)" > workbenchshutdown.py
xvfb-run --auto-servernum pytest --mpl tests
- name: Build python wheel # cannot be used without mantid
shell: bash -l {0}
run: |
python3 -m pip install setuptools==48.0.0
pip install check-wheel-contents
python -m build --wheel --no-isolation
check-wheel-contents dist/addie-*.whl # currently bad package
- name: Build conda libraray
shell: bash -l {0}
run: |
# set up environment
python3 -m pip install setuptools==47.0.0
conda install -y anaconda-client conda-build conda-verify boa
cd conda.recipe
echo "versioningit $(versioningit ../)"
# build the package
VERSION=$(versioningit ../) conda mambabuild --output-folder . . -c neutrons -c mantid
conda verify noarch/addie*.tar.bz2
- name: Deploy 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: |
# label is main or rc depending on the tag-name
CONDA_LABEL="main"
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
anaconda upload --label $CONDA_LABEL conda.recipe/noarch/addie-*.tar.bz2
trigger-deploy:
runs-on: ubuntu-22.04
needs: [linux]
# only trigger deploys from protected branches
if: ${{ github.ref_protected || github.ref_type == 'tag' }}
steps:
- name: Determine Environment
uses: neutrons/branch-mapper@v2
id: conda_env_name
with:
prefix: addie
- name: Trigger deploy
id: trigger
uses: eic/trigger-gitlab-ci@v2
with:
url: https://code.ornl.gov
token: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
project_id: 5749
ref_name: master
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 }}