This repository was archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (108 loc) · 4.8 KB
/
Copy pathci.yml
File metadata and controls
138 lines (108 loc) · 4.8 KB
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
name: Slamcore Python bindings CI
on: push
env:
PACKAGE_NAME: slamcore-dev
PACKAGE_VERSION: 23.04.31
DATASET: minimal
jobs:
build:
strategy:
matrix:
image: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"]
runs-on: ubuntu-latest
container: ${{matrix.image}}
outputs:
WHEEL_NAME_bionic: ${{ steps.build-wheel.outputs.WHEEL_NAME_bionic }}
WHEEL_NAME_focal: ${{ steps.build-wheel.outputs.WHEEL_NAME_focal }}
WHEEL_NAME_jammy: ${{ steps.build-wheel.outputs.WHEEL_NAME_jammy }}
steps:
- name: Checkout Slamcore Python bindings
uses: actions/checkout@v3
- name: Install dependencies
run: |
apt update
DEBIAN_FRONTEND=noninteractive apt install -y cmake ninja-build libeigen3-dev python3 python3-pip lsb-release
python3 -m pip install setuptools "pybind11[global]" mypy numpy wheel
- name: Get OS codename
run: echo "OS_CODENAME=$(lsb_release --codename | cut -f2)" >> $GITHUB_ENV
- name: Download Slamcore Dev package
uses: slamcore/s3-cp-action@v2
with:
aws_access_key_id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws_secret_access_key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
source: s3://slamcore-python/signed_packages/${{env.PACKAGE_NAME}}_${{env.PACKAGE_VERSION}}-${{env.OS_CODENAME}}1_github_amd64.deb
dest: deps/${{env.PACKAGE_NAME}}_${{env.PACKAGE_VERSION}}-${{env.OS_CODENAME}}1_github_amd64.deb
- name: Install Slamcore Dev package
run: apt install -y ./deps/${{env.PACKAGE_NAME}}_${{env.PACKAGE_VERSION}}-${{env.OS_CODENAME}}1_github_amd64.deb
- name: Configure CMake
run: mkdir build && cd build && cmake .. -GNinja
- name: Build library
run: cd build && ninja slamcore_python -v
- name: Build wheel
id: build-wheel
run: |
cd build && ninja slamcore_python_wheel -v
WHEEL_NAME=$(basename $(ls python/*.whl))
echo "WHEEL_NAME_${{env.OS_CODENAME}}=${WHEEL_NAME}" >> $GITHUB_OUTPUT
echo "WHEEL_NAME=${WHEEL_NAME}" >> $GITHUB_ENV
- name: Install wheel package
working-directory: build
run: python3 -m pip install python/*.whl
- name: Test import Slamcore Python package
run: python3 -c 'import slamcore'
- name: Upload Slamcore wheel package
uses: actions/upload-artifact@v3
with:
name: ${{env.WHEEL_NAME}}
path: build/python/*.whl
tests:
needs: build
strategy:
matrix:
image: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"]
test_suite: ["streams", "subsystems", "misc"]
runs-on: ubuntu-latest
container: ${{matrix.image}}
steps:
- name: Checkout Slamcore Python bindings
uses: actions/checkout@v3
- name: Install dependencies
run: |
apt update
DEBIAN_FRONTEND=noninteractive apt install -y zstd libeigen3-dev python3 python3-pip lsb-release
python3 -m pip install numpy pytest
- name: Get OS codename
run: echo "OS_CODENAME=$(lsb_release --codename | cut -f2)" >> $GITHUB_ENV
- name: Download Slamcore Dev package
uses: slamcore/s3-cp-action@v2
with:
aws_access_key_id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws_secret_access_key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
source: s3://slamcore-python/signed_packages/${{env.PACKAGE_NAME}}_${{env.PACKAGE_VERSION}}-${{env.OS_CODENAME}}1_github_amd64.deb
dest: deps/${{env.PACKAGE_NAME}}_${{env.PACKAGE_VERSION}}-${{env.OS_CODENAME}}1_github_amd64.deb
- name: Install Slamcore Dev package
run: apt install -y ./deps/${{env.PACKAGE_NAME}}_${{env.PACKAGE_VERSION}}-${{env.OS_CODENAME}}1_github_amd64.deb
- name: Get wheel name
run: |
WHEEL_NAME_bionic=${{ toJSON(needs.build.outputs.WHEEL_NAME_bionic) }}
WHEEL_NAME_focal=${{ toJSON(needs.build.outputs.WHEEL_NAME_focal) }}
WHEEL_NAME_jammy=${{ toJSON(needs.build.outputs.WHEEL_NAME_jammy) }}
echo "WHEEL_NAME=$WHEEL_NAME_${{env.OS_CODENAME}}" >> $GITHUB_ENV
- name: Download Slamcore wheel package
uses: actions/download-artifact@v3
with:
name: ${{env.WHEEL_NAME}}
path: ~/downloads
- name: Install wheel package
run: python3 -m pip install ~/downloads/*.whl
- name: Download dataset (${{env.DATASET}})
uses: slamcore/s3-cp-action@v2
with:
aws_access_key_id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws_secret_access_key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
source: s3://slamcore-python/datasets/${{env.DATASET}}.tar.zst
dest: downloads/${{env.DATASET}}.tar.zst
- name: Decompress dataset
run: mkdir datasets && tar --use-compress-program=unzstd -xvf downloads/${{env.DATASET}}.tar.zst -C datasets
- name: Run tests
run: python3 -m pytest -v --dataset datasets/${{env.DATASET}} tests/test_${{matrix.test_suite}}.py