Ubuntu #542
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 | |
pull_request: | |
schedule: | |
- cron: '0 5 * * *' | |
jobs: | |
get-tag: | |
# Pre-job to fetch the latest tag | |
runs-on: ubuntu-latest | |
outputs: | |
major: ${{ steps.extract_tag.outputs.major }} | |
minor: ${{ steps.extract_tag.outputs.minor }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Ensure all history and tags are fetched | |
- name: Get latest tag | |
id: extract_tag | |
run: | | |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) | |
echo "Latest tag: $latest_tag" | |
# Extract major and minor version from the tag | |
IFS='.' read -r major minor patch <<< "$latest_tag" | |
echo "Major: $major" | |
echo "Minor: $minor" | |
# Set as output variables | |
echo "::set-output name=major::$major" | |
echo "::set-output name=minor::$minor" | |
ci: | |
name: ${{ matrix.distro }} | |
needs: get-tag # Make sure the 'ci' job waits for the 'get-tag' job to finish | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
distro: [focal, jammy, noble] | |
container: | |
image: ghcr.io/tesseract-robotics/tesseract:${{ matrix.distro }}-${{ needs.get-tag.outputs.major }}.${{ needs.get-tag.outputs.minor }} | |
env: | |
CCACHE_DIR: "$GITHUB_WORKSPACE/${{ matrix.distro }}/.ccache" | |
DEBIAN_FRONTEND: noninteractive | |
TZ: Etc/UTC | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
path: target_ws/src | |
- name: Build and Tests | |
uses: tesseract-robotics/colcon-action@v8 | |
with: | |
before-script: source /opt/tesseract/install/setup.bash | |
ccache-prefix: ${{ matrix.distro }} | |
vcs-file: dependencies.repos | |
upstream-args: --cmake-args -DCMAKE_BUILD_TYPE=Release | |
target-path: target_ws/src | |
target-args: --cmake-args -DCMAKE_BUILD_TYPE=Debug -DTRAJOPT_ENABLE_TESTING=ON |