-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (67 loc) · 2.34 KB
/
test.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
name: KBase CDM Task Service tests
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
# run workflow when merging to main or develop
branches:
- main
- master
- develop
jobs:
task_service_tests:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- python-version: "3.11"
minio: "2024-10-02T17-50-41Z" # minimum supported version
mc: "2024-08-13T05-33-17Z"
steps:
- name: Repo checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and set up test config
shell: bash
run: |
export CRANE_VER=v0.20.2
export HOMEDIR=`pwd`
# set up python dependencies
pip install pipenv
pipenv sync --system --dev
# move to parent dir of homedir to install binaries etc
cd ..
# set up crane
# don't bother to verify provenance here
curl -sL "https://github.com/google/go-containerregistry/releases/download/$CRANE_VER/go-containerregistry_Linux_x86_64.tar.gz" > go-containerregistry.tar.gz
tar -zxf go-containerregistry.tar.gz
export CRANE_EXE_PATH=`pwd`/crane
# set up Minio
wget -q https://dl.minio.io/server/minio/release/linux-amd64/archive/minio.RELEASE.${{matrix.minio}} -O minio
chmod a+x minio
export MINIOD=`pwd`/minio
wget -q https://dl.minio.io/client/mc/release/linux-amd64/archive/mc.RELEASE.${{matrix.mc}} -O mc
chmod a+x mc
export MINIO_MC=`pwd`/mc
# set up test config
cd $HOMEDIR
cp test.cfg.example test.cfg
sed -i "s#^test.crane.exe=.*#test.crane.exe=$CRANE_EXE_PATH#" test.cfg
sed -i "s#^test.minio.exe=.*#test.minio.exe=$MINIOD#" test.cfg
sed -i "s#^test.minio.mc.exe=.*#test.minio.mc.exe=$MINIO_MC#" test.cfg
cat test.cfg
- name: Run tests
shell: bash
run: PYTHONPATH=. pytest --cov=cdmtaskservice --cov-report=xml test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true