Badge statuses shown based on pushing to the main branch #7
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: GCC Build | |
on: | |
pull_request: | |
branches: | |
- main | |
- master | |
push: | |
branches: | |
- main | |
- master | |
workflow_dispatch: | |
jobs: | |
#---LINUX BUILD JOB(S)--- | |
linux: | |
name: ${{ matrix.config.name }} | |
runs-on: ubuntu-latest | |
container: ubuntu:20.04 | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
oclus_build_type: "Release" | |
oclus_conan_path: "$HOME/.local/bin" | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
# - { | |
# name: "Ubuntu Clang", | |
# cc: "clang", cxx: "clang++", | |
# cmake_configure_options: '-DCMAKE_EXE_LINKER_FLAGS="-v -fuse-ld=lld"', | |
# } | |
- { | |
name: "Ubuntu GCC", | |
cc: "gcc", cxx: "g++", | |
} | |
steps: | |
# Add Kitware APT sources for CMake | |
- name: Add Kitware APT sources | |
shell: bash | |
run: | | |
# Update package lists | |
apt update -qq | |
# Add Kitware APT repository in order to use new version of CMake | |
apt install -y gpg wget | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null | |
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null | |
apt update -qq | |
rm /usr/share/keyrings/kitware-archive-keyring.gpg | |
apt install -y kitware-archive-keyring | |
# Install apt-packages | |
- name: Update environment | |
shell: bash | |
run: | | |
# Install build tools | |
apt install -y \ | |
gcc \ | |
g++ \ | |
clang \ | |
cmake \ | |
curl \ | |
lld \ | |
ninja-build \ | |
pkg-config | |
#Check out the repo | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
path: factory | |
#Configure CMake | |
- name: Configure CMake | |
shell: bash | |
run: | | |
export CC=${{ matrix.config.cc }} | |
export CXX=${{ matrix.config.cxx }} | |
# Configure cmake | |
cmake \ | |
-G Ninja \ | |
-D CMAKE_BUILD_TYPE=${{ env.oclus_build_type }} \ | |
-S $(pwd)/factory \ | |
-B $(pwd)/factory/build | |
#Build the code | |
- name: Build | |
shell: bash | |
run: | | |
cmake --build factory/build --config ${{ env.oclus_build_type }} -j4 | |