Skip to content

Commit

Permalink
Upload test results on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ToppDev committed Aug 10, 2024
1 parent e11ac75 commit a0b8a63
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 52 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ jobs:
working-directory: ./build
run: |
ctest -C ${{matrix.build_type}} --output-on-failure --timeout 180
- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: test/logs
- name: Coverage
if: ${{ runner.os == 'Linux' && matrix.build_type == 'Debug' && startsWith(matrix.compiler, 'gcc') }}
run: |
Expand Down
56 changes: 8 additions & 48 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
# branches: [ "main", "develop" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "develop" ]
branches: [ "main", "develop", "ci-cd" ]
schedule:
- cron: '38 0 * * 5'

Expand Down Expand Up @@ -51,81 +51,41 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Cache
uses: actions/cache@v3
uses: ./.github/actions/setup_cache
with:
path: ${{ github.workspace }}/conan-cache
key: ${{ runner.os }}-conan-${{ matrix.language }}-${{ matrix.compiler }}-${{ matrix.build_type }}
restore-keys: |
${{ runner.os }}-conan-
# uses: ./.github/actions/setup_cache
# with:
# compiler: ${{ matrix.compiler }}
# build_type: ${{ matrix.build_type }}
# doxygen: "OFF"

compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
brew: true
conan: "2.2.2"
ccache: true
conan: "2.6.0"
gcovr: "7.2"

- name: Setup Linux
run: |
sudo apt install -y libglfw3-dev libglfw3
- name: Cleanup Conan system packages (they are not properly cached)
run: |
conan remove -f '*/system/*' || true
- name: Create default Conan profile
run: |
conan profile detect
- name: Update Conan profile for Linux
if: ${{ runner.os == 'Linux' }}
run: |
conan profile detect --force
sed -i 's/compiler=.*/compiler=gcc/' ~/.conan2/profiles/default
sed -i 's/compiler.version=.*/compiler.version=11/' ~/.conan2/profiles/default
sed -i 's/compiler.libcxx=.*/compiler.libcxx=libstdc++11/' ~/.conan2/profiles/default
sed -i 's/build_type=.*/build_type=${{matrix.build_type}}/' ~/.conan2/profiles/default
sed -i 's/arch=.*/arch=x86_64/' ~/.conan2/profiles/default
sed -i 's/os=.*/os=Linux/' ~/.conan2/profiles/default
cat ~/.conan2/profiles/default
- name: Installing conan dependencies
run: |
conan install . --build=missing -s build_type=${{matrix.build_type}}
conan install . --build=missing -s build_type=${{matrix.build_type}} -s compiler.cppstd=17
- name: Configure CMake
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE="build/${{matrix.build_type}}/generators/conan_toolchain.cmake" -DENABLE_MAIN=TRUE -DENABLE_TESTING=TRUE -DENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} -DENABLE_DOXYGEN=OFF -DLOG_LEVEL:STRING=${{matrix.log-level}} -DWARNINGS_AS_ERRORS:BOOL=${{ !contains(matrix.os, 'windows' )}} -DENABLE_CPPCHECK=OFF -DENABLE_CLANG_TIDY=OFF -DENABLE_INCLUDE_WHAT_YOU_USE=OFF
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Build
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
config-file: ./.github/codeql/codeql-config.yml
8 changes: 4 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
run: |
sudo apt install -y libglfw3-dev libglfw3
sudo apt install -y flex bison graphviz dia mscgen pdf2svg texlive texlive-lang-german texlive-latex-extra ghostscript
- name: Cleanup Conan system packages (they are not properly cached)
run: |
conan remove -f '*/system'
- name: Check tool versions
uses: ./.github/actions/check_tool_versions
with:
documentation: true
- name: Installing conan dependencies
run: |
conan install . --build=missing -s build_type=Release
Expand Down

0 comments on commit a0b8a63

Please sign in to comment.