-
Notifications
You must be signed in to change notification settings - Fork 330
144 lines (127 loc) · 4.09 KB
/
cd.yaml
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
name: Lanelet2 CD
on:
push:
branches:
- master
tags:
- '*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
matrix:
# this should be kept in sync with ci.yaml
python-version: ["3.8", "3.9", "3.10", "3.11"]
include:
- python-version: "3.8"
boost-version: "1.75.0"
platform-version: manylinux_2_27_x86_64
image-version: conanio/gcc7:latest
- python-version: "3.9"
boost-version: "1.75.0"
platform-version: manylinux_2_27_x86_64
image-version: conanio/gcc7:latest
- python-version: "3.10"
boost-version: "1.81.0"
platform-version: manylinux_2_31_x86_64
image-version: conanio/gcc10:latest
- python-version: "3.11"
boost-version: "1.81.0"
platform-version: manylinux_2_31_x86_64
image-version: conanio/gcc10:latest
runs-on: ubuntu-latest
steps:
- name: Setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Create build container
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
file: .github/conan_dockerfile/Dockerfile
tags: lanelet2_conan_with_pip_wheel
load: true
target: lanelet2_conan_with_pip_wheel
build-args: |
FROM=${{ matrix.image-version }}
PY_VERSION=${{ matrix.python-version }}
PLATFORM=${{ matrix.platform-version }}
CONAN_ARGS=--require-override=boost/${{ matrix.boost-version }}
- name: Create output directory
run: mkdir -p ${{ github.workspace }}/output
- name: Package lanelet2 in build container
uses: addnab/docker-run-action@v3
with:
image: lanelet2_conan_with_pip_wheel
shell: bash
options: -v ${{ github.workspace }}/dist:/dist
run: |
set -e
# set env variables
export HOME=/home/conan
# copy wheel to dist directory
sudo cp -r $HOME/dist/* /dist
- name: Store wheel
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
test:
needs: build
strategy:
matrix:
# test only on currently supported version
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: ["ubuntu-22.04", "ubuntu-20.04"]
runs-on: ${{ matrix.os }}
steps:
- name: Restore wheel
uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install wheel
# use dist/ directory as package source instead of pypi.org
run: pip install lanelet2 --no-index --find-links dist/
- name: Test wheel
run: python -c "import lanelet2; assert lanelet2.core.Point2d(0, 0, 0) is not None"
publish:
if: contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build, test]
steps:
- name: Restore wheel
uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
- name: Publish package to PyPI
if: github.repository == 'fzi-forschungszentrum-informatik/Lanelet2'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
deploy-pages:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
concurrency: deploy-${{ github.ref }}
steps:
- uses: actions/checkout@v2
- name: set up python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: set up env
run: python -m pip install -r docs/requirements.txt
- name: copy docs to docs folder
run: bash docs/cp_docu_files.sh
- run: mkdocs gh-deploy --force