Skip to content

Commit

Permalink
Linux CI on Github Actions (#141)
Browse files Browse the repository at this point in the history
* Refs #17508: Added Github Action Skeleton

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Added More steps and both Ubuntu platforms

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Use eProsima CI actions for installing Python Dependencies

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Minor var name change

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Revision changes

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Use test/ branch

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Use main branch

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Added BUILD_TESTS flag

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Added temporal step for GTest backwards compatibility with Ubuntu20.04 as apt package was not installing correct FindGTest.cmake

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Return error on failed tests and avoid souble step installation of GTest

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #17508: Added step to upload test-results

Signed-off-by: Mario Dominguez <[email protected]>

---------

Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL authored Mar 17, 2023
1 parent 46bb474 commit 9de1a08
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/fastcdr-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# CI for Fast CDR repository
# The Action is triggered with a PR or push and every night at 00:00
# Additionally, it can be also triggered manually

name: Fast-CDR-test

on:

schedule:
- cron: '0 0 * * *'

push:

workflow_dispatch:
inputs:
cmake_args:
description: 'Optional CMake arguments'
required: false
type: string
default: ''
ctest_args:
description: 'Optional CTest arguments'
required: false
type: string
default: ''

pull_request:
branches:
- 'master'
paths-ignore:
- '**.md'
- '**.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:

#############################
###### UBUNTU BUILD #######
#############################
ubuntu-build-and-test:
name: Colcon build and test

if: ${{ !(contains(github.event.pull_request.labels.*.name, 'no-test') ||
contains(github.event.pull_request.labels.*.name, 'skip-ci')) }}

runs-on: ${{ matrix.ubuntu-version }}
strategy:
fail-fast: false
matrix:
ubuntu-version:
- 'ubuntu-20.04'
- 'ubuntu-22.04'

steps:
- name: Sync eProsima/Fast-CDR repository
uses: actions/checkout@v3
with:
path: src/Fast-CDR

- name: Install Colcon dependencies
uses: eProsima/eProsima-CI/ubuntu/install_colcon@main

# Temporal step as this platform will be discontinued soon
- name: Install Gtest Backwards Compatibility
if: ${{ matrix.ubuntu-version == 'ubuntu-20.04' }}
run: |
git clone --branch release-1.12.1 https://github.com/google/googletest.git && \
colcon build \
--event-handlers=console_direct+ \
--packages-select googletest-distribution
- name: Install Gtest
if: ${{ matrix.ubuntu-version == 'ubuntu-22.04' }}
uses: eProsima/eProsima-CI/ubuntu/install_gtest@feature/install_gtest

- name: Build
run: |
colcon build \
--event-handlers=console_direct+ \
--packages-select fastcdr \
--cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DEPROSIMA_BUILD_TESTS=ON \
${{ inputs.cmake_args }}
- name: Run Tests
run: |
colcon test \
--event-handlers=console_direct+ \
--packages-select fastcdr \
--return-code-on-test-failure \
--ctest-args ${{ inputs.ctest_args }}
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v1
with:
name: test-results-${{ matrix.ubuntu-version }}
path: log/latest_test/fastcdr

0 comments on commit 9de1a08

Please sign in to comment.