Skip to content

Commit

Permalink
test: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Oct 12, 2024
1 parent a1ae060 commit a01b16e
Showing 1 changed file with 9 additions and 75 deletions.
84 changes: 9 additions & 75 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
name: Build - Ubuntu
name: Build and Run Tests - Ubuntu

Check failure on line 1 in .github/workflows/build-ubuntu.yml

View workflow job for this annotation

GitHub Actions / yamllint

[yamllint] .github/workflows/build-ubuntu.yml#L1

[warning] missing document start "---" (document-start)
Raw output
./.github/workflows/build-ubuntu.yml:1:1: [warning] missing document start "---" (document-start)

on:
workflow_dispatch:
Expand All @@ -14,93 +13,28 @@ on:
branches:
- main

env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
MAKEFLAGS: "-j 2"

jobs:
cancel-runs:
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
buildtype: [linux-release, linux-debug]
include:
- os: ubuntu-22.04
triplet: x64-linux

steps:
- name: Checkout repository
uses: actions/checkout@main

- name: Install Linux Dependencies
run: >
sudo apt-get update && sudo apt-get install ccache linux-headers-$(uname -r)
- name: Switch to gcc-11
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
sudo update-alternatives --set gcc /usr/bin/gcc-11
- name: CCache
uses: hendrikmuhs/ccache-action@main
with:
max-size: "1G"
key: ccache-${{ matrix.os }}-${{ matrix.buildtype }}
restore-keys: |
ccache-${{ matrix.os }}
- name: Restore artifacts and install vcpkg
id: vcpkg-step
- name: Install Dependencies
run: |
vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ')
echo "vcpkg commit ID: $vcpkgCommitId"
echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> $GITHUB_ENV
- name: Get vcpkg commit id from vcpkg.json
uses: lukka/run-vcpkg@main
with:
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git"
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}

- name: Get latest CMake and ninja
uses: lukka/get-cmake@main
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Run CMake
uses: lukka/run-cmake@main
with:
configurePreset: ${{ matrix.buildtype }}
buildPreset: ${{ matrix.buildtype }}
configurePresetAdditionalArgs: "['-DBUILD_TESTS=ON']"

- name: Create and Upload Artifact
uses: actions/upload-artifact@main
with:
name: canary-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
path: |
${{ github.workspace }}/build/${{ matrix.buildtype }}/bin/
- name: Run Unit Tests
- name: Run Build and Tests
run: |
cd ${{ github.workspace }}/build/${{ matrix.buildtype }}/tests/unit
ctest --verbose
# - name: Run Integration Tests
# run: |
# cd ${{ github.workspace }}/build/${{ matrix.buildtype }}/tests/integration
# ctest --verbose
cd ${{ github.workspace }}/tests
chmod +x build_and_run.sh
./build_and_run.sh

0 comments on commit a01b16e

Please sign in to comment.