-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
139 lines (118 loc) · 3.1 KB
/
.gitlab-ci.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
stages:
- build
- pypi
variables:
PATH: "/opt/ipfs/bin:/usr/bin:/bin:/sbin"
.build:
script:
- apt-get update
- apt-get install -qy --force-yes python3-pip python3-venv
- mkdir -p /opt/ipfs/bin
- |-
# Match go-ipfs version number
if [[ "$IPFSD_TEST_RELEASE" =~ go-ipfs-([0-9].[0-9]+.[0-9]+) ]]; then
VER="${BASH_REMATCH[1]}"
curl -o go-ipfs.tar.gz \
https://dist.ipfs.tech/go-ipfs/v${VER}/go-ipfs_v${VER}_linux-amd64.tar.gz
tar -xvf go-ipfs.tar.gz && cp go-ipfs/ipfs /opt/ipfs/bin
fi
# Match kubo version number (will work with x.xx.xx)
if [[ "$IPFSD_TEST_RELEASE" =~ kubo-([0-9].[0-9]+.[0-9]+) ]]; then
VER="${BASH_REMATCH[1]}"
curl -o kubo.tar.gz \
https://dist.ipfs.tech/kubo/v${VER}/kubo_v${VER}_linux-amd64.tar.gz
tar -xvf kubo.tar.gz && cp kubo/ipfs /opt/ipfs/bin
fi
- ipfs version
- python3 -m venv venv
- source venv/bin/activate
- python -m pip install --upgrade pip
- pip install wheel build
- pip install '.[car,dev,bohort]'
- flake8 aioipfs tests --count --select=E9,F63,F7,F82 --show-source --statistics
- mypy aioipfs
- pytest --cov --cov-report=term --cov-report=xml:coverage.xml -v -s tests
- python -m build
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
artifacts:
paths:
- dist/*.whl
build-3.9:
extends: ".build"
stage: "build"
image: "python:3.9-bullseye"
parallel:
matrix:
- IPFSD_TEST_RELEASE: [
kubo-0.28.0
]
rules:
- if: $CI_COMMIT_MESSAGE =~ /\[test-39\]/
when: always
build-3.11:
extends: ".build"
stage: "build"
image: "python:3.11"
parallel:
matrix:
- IPFSD_TEST_RELEASE: [
kubo-0.28.0
]
rules:
- if: $CI_COMMIT_MESSAGE =~ /\[test-311\]/
when: always
build-3.12-post-020:
extends: ".build"
stage: "build"
image: "python:3.12"
parallel:
matrix:
- IPFSD_TEST_RELEASE: [
kubo-0.20.0,
kubo-0.22.0,
kubo-0.24.0,
kubo-0.26.0,
kubo-0.27.0,
kubo-0.28.0
]
rules:
- if: $CI_COMMIT_MESSAGE =~ /\[test-312-recent\]/
when: always
build-3.12-latest:
extends: ".build"
stage: "build"
image: "python:3.12"
parallel:
matrix:
- IPFSD_TEST_RELEASE: [
kubo-0.26.0,
kubo-0.28.0
]
rules:
- if: $CI_COMMIT_MESSAGE =~ /\[test-312-latest\]/
when: always
pypi:
image: "python:3.9-bullseye"
stage: pypi
cache: {}
rules:
- if: $CI_COMMIT_MESSAGE =~ /\[publish\]/ || $CI_COMMIT_MESSAGE =~ /\[pypi\]/
when: always
before_script:
- apt-get update
- apt-get install -qy --force-yes python3-pip python3-venv
script:
- python3 -m venv venv
- source venv/bin/activate
- python -m pip install --upgrade pip
- pip install .
- pip install -U twine build
- python -m build
- |-
echo "Branch is: $CI_COMMIT_BRANCH"
if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then
twine check dist/*.whl
twine upload dist/*
else
twine check dist/*.whl
fi