-
Notifications
You must be signed in to change notification settings - Fork 6
154 lines (133 loc) · 4.88 KB
/
conda.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Testing with conda
on:
push:
branches:
- 'main'
- 'release-*'
pull_request:
paths:
- '**'
- '!docs/**'
release:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Needed to get tags so that git describe works during package build
fetch-depth: "0"
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Miniforge and Pip packages
uses: actions/cache@v4
env:
CACHE_NUMBER: 0
with:
path: |
~/conda_pkgs_dir
~/.cache/pip
key:
${{runner.os}}-condapkg-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}
- name: Cache Miniforge environment
uses: actions/cache@v4
id: cache-miniforge-environment
env:
CACHE_NUMBER: 0
with:
path: ${CONDA}/envs/mantidimaging-dev.cache
key:
${{runner.os}}-condaenv-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml', 'setup.py')}}
- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: mantidimaging-dev
auto-activate-base: false
use-mamba: true
- name: Mantid Imaging developer dependencies
if: steps.cache-miniforge-environment.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
conda deactivate
python3 ./setup.py create_dev_env
cp -Ta ${CONDA}/envs/mantidimaging-dev ${CONDA}/envs/mantidimaging-dev.cache
- name: Mantid Imaging developer dependencies - from cache
if: steps.cache-miniforge-environment.outputs.cache-hit == 'true'
shell: bash -l {0}
run: |
cp -Ta ${CONDA}/envs/mantidimaging-dev.cache ${CONDA}/envs/mantidimaging-dev
- name: Other dependencies
shell: bash -l {0}
run: |
sudo apt update -y
sudo apt-get install -y xvfb libxcb* libxkb*
- name: List versions
shell: bash -l {0}
run: |
mamba env list
python --version; mamba list ; pip list
- name: Yapf
shell: bash -l {0}
run: |
yapf --parallel --diff --recursive .
- name: Ruff
shell: bash -l {0}
run: |
ruff check .
- name: mypy
shell: bash -l {0}
run: |
mypy --ignore-missing-imports mantidimaging
- name: pyright
shell: bash -l {0}
run: |
pyright mantidimaging
- name: pytest
timeout-minutes: 10
shell: bash -l {0}
run: |
xvfb-run --auto-servernum python -m pytest --cov --cov-report=xml -n auto --maxprocesses=4 --dist loadgroup -o log_cli=true --ignore=mantidimaging/eyes_tests --durations=10
- name: Get test data
shell: bash -l {0}
run: |
wget -nv https://github.com/mantidproject/mantidimaging-data/archive/refs/tags/small.zip
unzip -q small.zip -d ~
mv ~/mantidimaging-data-small ~/mantidimaging-data
timeout-minutes: 5
- name: GUI Tests System
shell: bash -l {0}
run: |
xvfb-run --auto-servernum /bin/time -v python -m pytest -vs -rs -p no:xdist -p no:randomly -p no:repeat -p no:cov -o log_cli=true --run-system-tests --durations=10
timeout-minutes: 30
- name: GUI Tests Screenshots Applitools
if: github.event_name == 'pull_request'
shell: bash -l {0}
env:
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
APPLITOOLS_BATCH_ID: ${{ github.sha }}
GITHUB_BRANCH_NAME: ${{ github.head_ref }}
run: |
xvfb-run --auto-servernum /bin/time -v python -m pytest -vs -rs -p no:xdist -p no:randomly -p no:repeat -p no:cov -o log_cli=true mantidimaging/eyes_tests --run-eyes-tests --durations=10
timeout-minutes: 15
- name: Coveralls
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
# Always label as unstable. Builds of stable releases can be manually labeled to 'main' once tested
- name: publish 'unstable' package
if: github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release')))
uses: ./.github/actions/publish-package
with:
label: unstable
token: ${{ secrets.ANACONDA_API_TOKEN_MANTIDIMAGING }}
token-old: ${{ secrets.ANACONDA_API_TOKEN }}