Feat/support conversions #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}_ | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Free disk space | |
continue-on-error: true | |
run: | | |
sudo swapoff -a | |
sudo rm -f /swapfile | |
sudo apt clean | |
docker rmi $(docker image ls -aq) | |
df -h | |
- name: Install Depends | |
run: | | |
apt update | |
apt upgrade -y | |
apt install -y cmake curl lsb-release liboctomap-dev ca-certificates gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo 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" | \ | |
sudo 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 | |
- 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/cache@v1.1.0 | |
with: | |
path: ${{ matrix.distro }}/.ccache | |
key: ${{ matrix.distro }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} | |
restore-keys: | | |
${{ matrix.distro }}-ccache- | |
- name: Login to Github container registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker meta-information | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=false | |
prefix= | |
suffix= | |
tags: | | |
type=ref,event=branch,prefix=${{ matrix.distro }}- | |
type=semver,pattern={{major}}.{{minor}},prefix=${{ matrix.distro }}- | |
- name: Set build type | |
run: | | |
if [[ "${{ env.PUSH_DOCKER_IMAGE }}" = true ]] | |
then | |
echo "BUILD_TYPE=Release" >> $GITHUB_ENV | |
else | |
echo "BUILD_TYPE=Debug" >> $GITHUB_ENV | |
fi | |
- name: Build repository | |
run: | | |
apt install -y curl lsb-release liboctomap-dev | |
./.github/workflows/add_ros_apt_sources.sh | |
mkdir ${BASEDIR}/${PREFIX}upstream_ws | |
mkdir ${BASEDIR}/${PREFIX}upstream_ws/src | |
vcs import --input "dependencies.repos" ${BASEDIR}/${PREFIX}upstream_ws/src/ | |