-
Notifications
You must be signed in to change notification settings - Fork 17
184 lines (158 loc) · 5.38 KB
/
ci_pipeline.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
name: CI pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
cache: pip
- name: Install python packages
run: pip install pre-commit==2.20.0
- name: Lint
run: pre-commit run --all-files --verbose --show-diff-on-failure
build-test:
runs-on: ubuntu-22.04
needs: lint
strategy:
fail-fast: false
matrix:
ros_distro:
- noetic
- humble
- iron
- jazzy
include:
- ros_distro: humble
upload_artifacts: true
container:
image: ros:${{ matrix.ros_distro }}-ros-base
steps:
- name: Install debian packages
run: >-
sudo apt-get update && sudo apt-get install -y \
gcovr \
git \
lcov \
python3-colcon-common-extensions \
python3-colcon-coveragepy-result \
python3-colcon-lcov-result \
python3-colcon-mixin \
python3-pip \
python3-vcstool
- name: Install python packages
run: |
export PIP_BREAK_SYSTEM_PACKAGES=1
pip install pre-commit==2.20.0 \
h5py==3.11.0
- name: Checkout repository
uses: actions/checkout@v3
with:
path: ${{ github.workspace }}/src/beluga
- name: Import external repositories
working-directory: ${{ github.workspace }}/src
run: |
vcs import < ./beluga/docker/files/${{ matrix.ros_distro }}.repos
rm -rf ./flatland
- name: Install dependencies
run: |
. /opt/ros/${{ matrix.ros_distro }}/setup.sh
export PIP_BREAK_SYSTEM_PACKAGES=1
rosdep update
sudo -E rosdep install -r --from-paths src -y -i -t exec -t build -t doc -t test
colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/c75e4b34a3959524564afb584e2aa33c7eec323c/index.yaml
colcon mixin update default
- name: Setup compiler cache
uses: Chocobo1/setup-ccache-action@v1
with:
api_token: ${{ secrets.GITHUB_TOKEN }}
update_packager_index: false
override_cache_key: ccache-${{ matrix.ros_distro }}-${{ github.head_ref || github.ref_name }}
override_cache_key_fallback: |
ccache-${{ matrix.ros_distro }}-${{ github.base_ref || github.ref_name }}
ccache-${{ matrix.ros_distro }}-
- name: Build and test
working-directory: ${{ github.workspace }}
run: ./src/beluga/tools/build-and-test.sh
- name: Perform static analysis
working-directory: ${{ github.workspace }}
run: ./src/beluga/tools/run-clang-tidy.sh
- name: Enforce code coverage
working-directory: ${{ github.workspace }}
run: ./src/beluga/tools/check-code-coverage.sh
- name: Upload code coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov/total_coverage.info,./coveragepy/.coverage
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
if: ${{ matrix.upload_artifacts && !github.event.pull_request.head.repo.fork }}
build-docs:
needs: build-test
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
cache: pip
- name: Install tooling dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
doxygen \
git \
graphviz \
make \
texlive-latex-base
pip install -r docs/requirements.txt
- name: Build documentation
run: make -C docs html
- name: Upload documentation artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: ./docs/_build/html/
include-hidden-files: true
retention-days: 7
deploy-docs:
needs: build-docs
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- name: Checkout documentation branch
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Configure username
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Remove current documentation
run: |
git rm -rf .
- name: Download documentation artifacts
uses: actions/download-artifact@v3
with:
name: docs
- name: Deploy documentation
env:
COMMIT_MESSAGE: "Triggered by commit ${{ github.sha }}."
COMMIT_CO_AUTHOR: "Co-authored-by: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
run: |
git add --all
git commit -m "Update documentation" -m "${{ env.COMMIT_MESSAGE }}" -m "${{ env.COMMIT_CO_AUTHOR }}" || true
git push