Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
Update `.github/workflows/linux.yml`

Update `.github/workflows/linux.yml`

Fix typo in `.github/workflows/linux.yml`

Update workflows.

Update windows workflow
  • Loading branch information
greg7mdp committed Sep 21, 2024
1 parent c81f756 commit 4c0a7a1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 78 deletions.
49 changes: 20 additions & 29 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,28 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
compiler: [g++-9, g++-10, clang++-17]
build_type: [Debug, Release]
standard: [20]
os: [ubuntu-latest]
compiler: [g++, clang++]
flags: [-std=c++20]
optimize: [-O2]

env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }}
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
CTEST_PARALLEL_LEVEL: 0
CMAKE_BUILD_PARALLEL_LEVEL: 4

steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: Create Environment
run: |
sudo apt update
sudo apt install -y g++-9 g++-10
wget https://apt.llvm.org/llvm.sh; chmod u+x llvm.sh; sudo ./llvm.sh 17
cmake -E make_directory ${{runner.workspace}}/build
uses: actions/checkout@v4

- name: Configure
working-directory: ${{runner.workspace}}/build
env:
CXX: ${{ matrix.compiler }}
run: |
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} $GITHUB_WORKSPACE
- name: CMake configure
run: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release -B build

- name: Build
working-directory: ${{runner.workspace}}/build
run: |
cpus=`nproc`
cmake --build . --config ${{matrix.build_type}} --parallel $cpus
- name: CMake build
run: cmake --build build

- name: Test
working-directory: ${{runner.workspace}}/build
env:
CTEST_OUTPUT_ON_FAILURE: True
run: |
ctest -C ${{matrix.build_type}}
- name: CMake test
run: ctest --test-dir build
43 changes: 20 additions & 23 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,28 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, macos-latest]
build_type: [Debug, Release]
standard: [20]
os: [macos-latest]
compiler: [g++, clang++]
flags: [-std=c++20]
optimize: [-O2]

env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }}
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
CTEST_PARALLEL_LEVEL: 0
CMAKE_BUILD_PARALLEL_LEVEL: 4

steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: Create Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build
uses: actions/checkout@v4

- name: Configure
working-directory: ${{runner.workspace}}/build
run: |
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} $GITHUB_WORKSPACE
- name: CMake configure
run: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release -B build

- name: Build
working-directory: ${{runner.workspace}}/build
run: |
cpus=`sysctl -n hw.logicalcpu`
cmake --build . --config ${{matrix.build_type}} --parallel $cpus
- name: CMake build
run: cmake --build build

- name: Test
working-directory: ${{runner.workspace}}/build
env:
CTEST_OUTPUT_ON_FAILURE: True
run: |
ctest -C ${{matrix.build_type}}
- name: CMake test
run: ctest --test-dir build
44 changes: 18 additions & 26 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,26 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, windows-2022]
platform: [Win32, x64]
build_type: [Debug, Release]
standard: [20]
os: [windows-latest]
flags: ["/std:c++20", "/std:c++latest"]
optimize: [/O2]

env:
CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }}
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_NO_TESTS_ACTION: error
CTEST_PARALLEL_LEVEL: 0
CMAKE_BUILD_PARALLEL_LEVEL: 4

steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: Create Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build
uses: actions/checkout@v4

- name: Configure
# bash shell for $GITHUB_WORKSPACE
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake -A ${{matrix.platform}} -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} $GITHUB_WORKSPACE
- name: CMake configure
run: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -B build

- name: Build
working-directory: ${{runner.workspace}}/build
run: |
$cpus = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
cmake --build . --config ${{matrix.build_type}} --parallel $cpus
- name: CMake build
run: cmake --build build --config Release

- name: Test
working-directory: ${{runner.workspace}}/build
env:
CTEST_OUTPUT_ON_FAILURE: True
run: |
ctest -C ${{matrix.build_type}}
- name: CMake test
run: ctest --test-dir build -C Release

0 comments on commit 4c0a7a1

Please sign in to comment.