Skip to content

Commit aa23b87

Browse files
author
John McFarlane
committed
Reconsolidate GitHub Actions workflows
1 parent b131238 commit aa23b87

File tree

2 files changed

+115
-127
lines changed

2 files changed

+115
-127
lines changed

Diff for: .github/workflows/pr.yml

-127
This file was deleted.

Diff for: .github/workflows/push.yml renamed to .github/workflows/test.yml

+115
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,119 @@ jobs:
340340
with:
341341
name: documentation
342342
path: ${{github.workspace}}/htdocs
343+
344+
# Build and test latest on Linux using only CMake
345+
cmake:
346+
strategy:
347+
fail-fast: false
348+
matrix:
349+
compiler: [gcc, clang]
350+
include:
351+
- compiler: clang
352+
stdlib-flag: "-stdlib=libc++"
353+
toolchain: clang-libc++.cmake
354+
container: johnmcfarlane/cnl_ci:clang-head-libcpp
355+
- compiler: gcc
356+
stdlib-flag: "-fsanitize=address,undefined"
357+
toolchain: gcc.cmake
358+
container: johnmcfarlane/cnl_ci:gcc-12
359+
build_type: ["Release", "Debug"]
360+
cxx-extensions: ["ON", "OFF"]
361+
exceptions: ["ON", "OFF"]
362+
363+
container: ${{matrix.container}}
364+
runs-on: ubuntu-20.04
365+
366+
steps:
367+
- uses: actions/checkout@v2
368+
369+
- name: Restore Compiler Cache
370+
uses: hendrikmuhs/ccache-action@v1
371+
env:
372+
CACHE_SLUG: cmake-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ matrix.cxx-extensions }}-${{ matrix.exceptions }}
373+
with:
374+
key: ${{ env.CACHE_SLUG }}-${{ hashFiles('test/toolchain/**') }}
375+
376+
- name: Cache Report
377+
run: |
378+
ccache -s
379+
380+
- name: Build and Install GTest
381+
env:
382+
CXXFLAGS: ${{matrix.stdlib-flag}}
383+
run: |
384+
git clone https://github.com/google/googletest.git
385+
cd googletest
386+
git checkout 8d51dc50eb7e7698427fed81b85edad0e032112e
387+
cmake \
388+
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \
389+
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=$GITHUB_WORKSPACE/test/toolchain/${{matrix.toolchain}} \
390+
.
391+
cmake --build . --target install
392+
393+
- name: Configure CNL
394+
run: |
395+
cmake \
396+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
397+
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \
398+
-DCMAKE_CXX_EXTENSIONS=${{matrix.cxx-extensions}} \
399+
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=$GITHUB_WORKSPACE/test/toolchain/${{matrix.toolchain}} \
400+
-DCNL_EXCEPTIONS=${{matrix.exceptions}} \
401+
-DCNL_SANITIZE=ON \
402+
$GITHUB_WORKSPACE
403+
404+
- name: Build CNL
405+
run: cmake --build $GITHUB_WORKSPACE --target test-all
406+
407+
- name: Test CNL
408+
run: ctest --output-on-failure
409+
410+
# Install on mature Linux distro using only CMake
411+
install:
412+
runs-on: ubuntu-18.04
413+
steps:
414+
- uses: actions/checkout@v2
415+
416+
- name: Configure CNL
417+
run: cmake $GITHUB_WORKSPACE
418+
419+
- name: Install CNL
420+
run: sudo cmake --build $GITHUB_WORKSPACE --target install
421+
422+
# Test shell scripts
423+
shellcheck:
424+
runs-on: ubuntu-20.04
425+
container: johnmcfarlane/cnl_ci:base-20.04
426+
steps:
427+
- uses: actions/checkout@v2
428+
429+
- name: Run shellcheck
430+
shell: bash
431+
run: |
432+
git config --global --add safe.directory $GITHUB_WORKSPACE
433+
$GITHUB_WORKSPACE/test/scripts/shellcheck
434+
435+
# Test markdown
436+
markdownlint:
437+
runs-on: ubuntu-20.04
438+
steps:
439+
- uses: actions/checkout@v2
440+
441+
- name: Run markdownlint
442+
shell: bash
443+
run: |
444+
sudo snap install mdl
445+
$GITHUB_WORKSPACE/test/scripts/markdownlint
446+
447+
# Test YAML
448+
yamllint:
449+
runs-on: ubuntu-20.04
450+
steps:
451+
- uses: actions/checkout@v2
452+
453+
- name: Run yamllint
454+
shell: bash
455+
run: |
456+
sudo apt install yamllint
457+
$GITHUB_WORKSPACE/test/scripts/yamllint
343458
...

0 commit comments

Comments
 (0)