Skip to content

Upgrade Docker Builder #402

Upgrade Docker Builder

Upgrade Docker Builder #402

Workflow file for this run

name: Unit and Integration Tests
on:
pull_request:
branches: ["development"]
push:
branches: ["development"]
workflow_dispatch:
concurrency:
group: "tests"
cancel-in-progress: false
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
type: [Unit, Integration]
runs-on: [self-hosted, linux, X64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fix Dubious Ownership
run: git config --global --add safe.directory /opt/Autonomy_Software
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Update Branch
run: |
cd /opt/Autonomy_Software/
git fetch --force
branch=${{ steps.extract_branch.outputs.branch }}
echo $branch
git reset --hard origin/$branch
git checkout $branch
git pull
- name: Build Tests
run: |
cd /opt/Autonomy_Software/
if [ -d "build" ]; then rm -Rf build; fi
mkdir build
cd build
cmake ..
make
- name: Check File Existence (${{ matrix.type }} Tests)
id: check
uses: andstor/file-existence-action@v2
with:
files: "/opt/Autonomy_Software/build/Autonomy_Software_${{ matrix.type }}Tests"
- name: Run ${{ matrix.type }} Tests
if: steps.check.outputs.files_exists == 'true'
run: |
cd /opt/Autonomy_Software/build
if test -f "Autonomy_Software_${{ matrix.type }}Tests"; then ./Autonomy_Software_${{ matrix.type }}Tests ; else echo "No ${{ matrix.type }} Tests Exist" ; fi