-
Notifications
You must be signed in to change notification settings - Fork 29
141 lines (131 loc) · 4.85 KB
/
ci.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
---
name: MIL CI
# We do not trigger on the pull_request hook because it will have already been
# triggered by the push hook!
# yamllint disable-line rule:truthy
on:
[push, workflow_dispatch]
env:
# The version of caching we are using. This can be upgraded if we
# significantly change CI to the point where old caches become irrelevant.
CACHE_VERSION: 0
# Default Python version. Noetic defaults to 3.8.
DEFAULT_PYTHON: 3.8
# Location of the pre-commit cache. This is set by pre-commit, not us!
PRE_COMMIT_CACHE: ~/.cache/pre-commit
# Cancels this run if a new one referring to the same object and same workflow
# is requested
concurrency:
group: >
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
super-ci:
name: Run tests and build docs
runs-on: self-hosted
steps:
- name: Configure catkin workspace folder structure
run: |
mkdir -p $GITHUB_WORKSPACE/catkin_ws/src
- name: Check out code from GitHub
uses: actions/[email protected]
with:
submodules: recursive
path: catkin_ws/src/mil
- name: Setup ROS Noetic
uses: ros-tooling/[email protected]
with:
required-ros-distributions: noetic
- name: Install pip dependencies
run: |
cd $GITHUB_WORKSPACE/catkin_ws/src/mil
pip install -r requirements.txt
- name: Install system dependencies
# GH-803: This should not need continue-on-error: true
continue-on-error: true
run: |
cd $GITHUB_WORKSPACE/catkin_ws/src/mil
./scripts/install.sh
- name: Install BlueView Sonar SDK
run: |
cd $GITHUB_WORKSPACE/catkin_ws/src/mil
./scripts/hardware_installers/install_bvtsdk --pass ${{ secrets.ZOBELISK_PASSWORD }}
ls mil_common/drivers/mil_blueview_driver
echo $PWD
- name: Run catkin_make
run: |
export HOME=$GITHUB_WORKSPACE # Temporary fix for setup scripts
cd $GITHUB_WORKSPACE/catkin_ws
ls src/mil/mil_common/drivers/mil_blueview_driver
source /opt/ros/noetic/setup.bash
rm -rf build devel
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.8 \
-j6
# We want to run a full test suite in CI - this includes the BlueView
# tests!
- name: Run pylint
run: |
cd $GITHUB_WORKSPACE/catkin_ws/src/mil
source /opt/ros/noetic/setup.bash
source ../../devel/setup.bash
pylint $(git ls-files "*.py") --jobs=0
- name: Run catkin_make tests
run: |
export HOME=$GITHUB_WORKSPACE # Temporary fix for setup scripts
cd $GITHUB_WORKSPACE/catkin_ws
source /opt/ros/noetic/setup.bash
source devel/setup.bash
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.8 \
-j6 \
run_tests
- name: Get test results
run: >
source /opt/ros/noetic/setup.bash
catkin_test_results $GITHUB_WORKSPACE/catkin_ws/build/test_results
--verbose
- name: Build docs
run: |
export HOME=$GITHUB_WORKSPACE # Temporary fix for setup scripts
mkdir -p $HOME/.mil
source /opt/ros/noetic/setup.bash
source $GITHUB_WORKSPACE/catkin_ws/devel/setup.bash
cd $GITHUB_WORKSPACE/catkin_ws/src/mil
./scripts/build_docs -s -d
- name: Publish docs artifact
uses: actions/upload-artifact@v3
with:
name: docs-ci-html-${{ github.sha }}
path: ${{ github.workspace }}/.mil/docs/html
deploy-docs:
name: Deploy docs from master
runs-on: ubuntu-latest
needs:
- super-ci
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Make folders
run: |
mkdir -p $GITHUB_WORKSPACE/build/docs
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs-ci-html-${{ github.sha }}
path: ${{ github.workspace }}/build/docs
# We need to install rsync for GitHub Pages deploy action
- name: Install rsync
run: |
sudo apt-get upgrade && sudo apt-get update && sudo apt-get install -y rsync
# Publish the artifact to the GitHub Pages branch
- name: Push docs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.INVESTIGATOR_BOT_TOKEN }}
branch: main
repository-name: uf-mil/uf-mil.github.io
folder: ${{ github.workspace }}/build/docs
target-folder: docs
commit-message: Updating docs to ${{ github.sha }}