-
Notifications
You must be signed in to change notification settings - Fork 5
80 lines (73 loc) · 2.31 KB
/
test-user-package.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
name: Test User Package
on:
workflow_dispatch:
inputs:
version:
type: string
required: true
description: "version: PEP440 package-version"
buildDocker:
type: boolean
required: false
default: false
description: "build docker-img if tests succeeded? DON't enable if you don't know what PEP440 is!"
latestDocker:
type: boolean
required: false
default: false
description: "tag docker-img as latest (if `buildDocker` is enabled)"
workflow_call:
inputs:
version:
type: string
required: true
buildDocker:
type: boolean
required: false
default: false
latestDocker:
type: boolean
required: false
default: false
jobs:
test-conda-build:
runs-on: ubuntu-latest
steps:
- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
mamba-version: "*"
channels: conda-forge
channel-priority: "true"
conda-remove-defaults: "true"
- name: Set variables, Install Package & Dependencies
shell: bash -l {0}
run: |
KARABO_VERSION=${{ inputs.version }}
DEV_STR="dev"
if [[ "$KARABO_VERSION" == *"$DEV_STR"* ]] && [[ ${{ inputs.latestDocker }} == 'true' ]]; then
echo "Invalid configuration of workflow-inputs!"
exit 1
fi
export IS_GITHUB_RUNNER=true
export RUN_NOTEBOOK_TESTS=false
conda install -y -n base conda-libmamba-solver
conda config --set solver libmamba
conda config --env --set channel_priority true
conda create -y -n karabo-env python=3.9
conda activate karabo-env
conda install -y -c nvidia/label/cuda-11.7.0 -c i4ds -c conda-forge karabo-pipeline=$KARABO_VERSION
pip install ipykernel
python -m ipykernel install --user --name python3
- name: Test Package
shell: bash -l {0}
run: |
conda activate karabo-env
pytest --pyargs karabo.test
build-docker:
needs: test-conda-build
if: ${{ inputs.buildDocker }}
uses: ./.github/workflows/build-docker-image.yml
with:
verstag: ${{ inputs.version }}
latest: ${{ inputs.latestDocker }}