-
Notifications
You must be signed in to change notification settings - Fork 88
84 lines (77 loc) · 3.14 KB
/
ubuntu_test.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
name: Ubuntu
on:
push:
branches:
- master
- 'dev**'
pull_request:
paths:
- 'tesseract**'
- '.github/workflows/ubuntu.yml'
- '**.repos'
schedule:
- cron: '0 5 * * *'
release:
types:
- released
jobs:
ci:
name: ${{ matrix.distro }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro: [focal, jammy]
container:
image: ubuntu:${{ matrix.distro }}
env:
CCACHE_DIR: "${{ github.workspace }}/${{ matrix.distro }}/.ccache"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
PUSH_DOCKER_IMAGE: ${{ github.ref == 'refs/heads/master' || github.event_name == 'release' }}
BASEDIR: /opt
PREFIX: ${{ github.repository }}_
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Depends
run: |
apt update
apt upgrade -y
apt install -y cmake curl lsb-release ca-certificates gnupg python3 python3-distutils python3-pip
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
python3 -m pip install vcstool -q
python3 -m pip install colcon-common-extensions -q
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
continue-on-error: true
uses: actions/[email protected]
with:
path: ${{ matrix.distro }}/.ccache
key: ${{ matrix.distro }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.distro }}-ccache-
- name: Build Upstream Workspace
run: |
./.github/workflows/add_ros_apt_sources.sh
apt install -y liboctomap-dev libfcl-dev libconsole-bridge-dev libbullet-dev libbullet-extras-dev libyaml-cpp-dev libtinyxml2-dev libassimp-dev liborocos-kdl-dev libpcl-dev liblapack-dev libboost-dev libboost-filesystem-dev libboost-serialization-dev libboost-program-options-dev libboost-graph-dev libbenchmark-dev libccd-dev libgtest-dev
mkdir -p ${BASEDIR}/${PREFIX}upstream_ws/src
vcs import --input "dependencies.repos" ${BASEDIR}/${PREFIX}upstream_ws/src/
pwd
cd ${BASEDIR}/${PREFIX}upstream_ws
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release -DTESSERACT_ENABLE_TESTING=ON