-
Notifications
You must be signed in to change notification settings - Fork 14
194 lines (187 loc) · 6.89 KB
/
main.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Main CI workflow
# Note: If the workflow name is changed, the CI badge URL in the README must also be updated
on:
push: # Push trigger runs on any pushed branch.
schedule: # Scheduled trigger runs on the latest commit on the default branch.
- cron: '0 22 * * *'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: false
- name: Build and lint
# Linting job should be run on the latest Ubuntu release that we can support
run: |
docker run \
--volume $PWD:/host \
--workdir /host/continuous-integration/linux \
--env "PYTHONDONTWRITEBYTECODE=1" \
ubuntu:24.04 \
bash -c "./setup.sh && ./install-sdk.sh && ./build.sh && ./lint.sh"
- name: Notify Teams
if: ${{ failure() && github.ref == 'refs/heads/master' }}
env:
CI_FAILURE_TEAMS_HOOK: ${{ secrets.CI_FAILURE_TEAMS_HOOK }}
run: python continuous-integration/notification/notify_teams.py --status ${{ job.status }}
create-source-distribution:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: false
- name: Create source distribution
run: |
docker run \
--volume $PWD:/host \
--workdir /host/continuous-integration/linux \
--env "PYTHONDONTWRITEBYTECODE=1" \
ubuntu:20.04 \
bash -c "./setup.sh && ./create-source-distribution.sh"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: source-distribution
path: dist/zivid*.tar.gz
retention-days: 1
- name: Notify Teams
if: ${{ failure() && github.ref == 'refs/heads/master' }}
env:
CI_FAILURE_TEAMS_HOOK: ${{ secrets.CI_FAILURE_TEAMS_HOOK }}
run: python continuous-integration/notification/notify_teams.py --status ${{ job.status }}
create-windows-binary-distribution:
runs-on: windows-2019
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: false
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Setup
run: python continuous-integration\windows\setup.py
- name: Create binary distribution
env:
Zivid_DIR: 'C:\Program Files\Zivid\CMake\Zivid'
CXX: 'cl.exe'
CC: 'cl.exe'
run: python continuous-integration\windows\create_binary_distribution.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bdist-win-python${{matrix.python-version}}
path: dist/zivid*.whl
retention-days: 1
- name: Notify Teams
if: ${{ failure() && github.ref == 'refs/heads/master' }}
env:
CI_FAILURE_TEAMS_HOOK: ${{ secrets.CI_FAILURE_TEAMS_HOOK }}
run: python continuous-integration/notification/notify_teams.py --status ${{ job.status }}
test-linux-source-distribution:
needs: create-source-distribution
runs-on: ubuntu-latest
# Build & test job should be run on:
# - All Ubuntu versions officially supported by Zivid SDK
# - All (not end-of-life) Ubuntu versions newer than the latest LTS
# - The three latest Fedora releases that we can support
strategy:
matrix:
os:
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:23.10
- ubuntu:24.04
- fedora:39
- fedora:40
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: true
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: source-distribution
path: dist
- name: Install from source-distribution and test
run: |
docker run \
--volume $PWD:/host \
--workdir /host/continuous-integration/linux \
--env "PYTHONDONTWRITEBYTECODE=1" \
${{matrix.os}} \
bash -c "./setup.sh && ./install-sdk.sh && ./build-and-install-source-distribution.sh && ./setup-opencl.sh && ./test.sh"
- name: Notify Teams
if: ${{ failure() && github.ref == 'refs/heads/master' }}
env:
CI_FAILURE_TEAMS_HOOK: ${{ secrets.CI_FAILURE_TEAMS_HOOK }}
run: python continuous-integration/notification/notify_teams.py --status ${{ job.status }}
test-windows-binary-distribution:
needs: create-windows-binary-distribution
runs-on: windows-2019
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: true
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: bdist-win-python${{matrix.python-version}}
path: dist
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Setup
run: python continuous-integration\windows\setup.py
- name: Install from binary distribution
run: python continuous-integration\windows\install_binary_distribution.py
- name: Test
run: python continuous-integration\windows\test.py
- name: Notify Teams
if: ${{ failure() && github.ref == 'refs/heads/master' }}
env:
CI_FAILURE_TEAMS_HOOK: ${{ secrets.CI_FAILURE_TEAMS_HOOK }}
run: python continuous-integration/notification/notify_teams.py --status ${{ job.status }}
deploy:
needs: [lint, test-linux-source-distribution, test-windows-binary-distribution]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: false
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Collect and check
run: |
docker run \
--volume $PWD:/host \
--workdir /host/continuous-integration/linux \
--env "PYTHONDONTWRITEBYTECODE=1" \
ubuntu:20.04 \
bash -c "./collect-and-check-artifacts.sh"
- name: Upload all as single artifact
uses: actions/upload-artifact@v4
with:
name: distributions_all
path: distribution/
- name: Notify Teams
if: ${{ failure() && github.ref == 'refs/heads/master' }}
env:
CI_FAILURE_TEAMS_HOOK: ${{ secrets.CI_FAILURE_TEAMS_HOOK }}
run: python continuous-integration/notification/notify_teams.py --status ${{ job.status }}