Skip to content

Commit 2c73071

Browse files
committed
Update workflows.
1 parent 0d20da8 commit 2c73071

File tree

2 files changed

+36
-47
lines changed

2 files changed

+36
-47
lines changed

.github/workflows/macos.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,28 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: [macos-11, macos-latest]
14-
build_type: [Debug, Release]
15-
standard: [20]
13+
os: [macos-latest]
14+
compiler: [g++, clang++]
15+
flags: [-std=c++20]
16+
optimize: [-O2]
17+
18+
env:
19+
CXX: ${{ matrix.compiler }}
20+
CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }}
21+
CTEST_OUTPUT_ON_FAILURE: 1
22+
CTEST_NO_TESTS_ACTION: error
23+
CTEST_PARALLEL_LEVEL: 0
24+
CMAKE_BUILD_PARALLEL_LEVEL: 4
25+
1626
steps:
1727
- name: Checkout
1828
uses: actions/checkout@v4
1929

20-
- name: Create Environment
21-
run: |
22-
cmake -E make_directory ${{runner.workspace}}/build
23-
24-
- name: Configure
25-
working-directory: ${{runner.workspace}}/build
26-
run: |
27-
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} $GITHUB_WORKSPACE
30+
- name: CMake configure
31+
run: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release -B build
2832

29-
- name: Build
30-
working-directory: ${{runner.workspace}}/build
31-
run: |
32-
cpus=`sysctl -n hw.logicalcpu`
33-
cmake --build . --config ${{matrix.build_type}} --parallel $cpus
33+
- name: CMake build
34+
run: cmake --build build
3435

35-
- name: Test
36-
working-directory: ${{runner.workspace}}/build
37-
env:
38-
CTEST_OUTPUT_ON_FAILURE: True
39-
run: |
40-
ctest -C ${{matrix.build_type}}
36+
- name: CMake test
37+
run: ctest --test-dir build

.github/workflows/windows.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,26 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: [windows-2019, windows-2022]
14-
platform: [Win32, x64]
15-
build_type: [Debug, Release]
16-
standard: [20]
13+
os: [windows-latest]
14+
flags: ["/std:c++11", "/std:c++latest"]
15+
optimize: [/O2]
16+
17+
env:
18+
CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }}
19+
CTEST_OUTPUT_ON_FAILURE: 1
20+
CTEST_NO_TESTS_ACTION: error
21+
CTEST_PARALLEL_LEVEL: 0
22+
CMAKE_BUILD_PARALLEL_LEVEL: 4
23+
1724
steps:
1825
- name: Checkout
1926
uses: actions/checkout@v4
2027

21-
- name: Create Environment
22-
run: |
23-
cmake -E make_directory ${{runner.workspace}}/build
24-
25-
- name: Configure
26-
# bash shell for $GITHUB_WORKSPACE
27-
shell: bash
28-
working-directory: ${{runner.workspace}}/build
29-
run: |
30-
cmake -A ${{matrix.platform}} -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} $GITHUB_WORKSPACE
28+
- name: CMake configure
29+
run: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -B build
3130

32-
- name: Build
33-
working-directory: ${{runner.workspace}}/build
34-
run: |
35-
$cpus = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
36-
cmake --build . --config ${{matrix.build_type}} --parallel $cpus
31+
- name: CMake build
32+
run: cmake --build build --config Release
3733

38-
- name: Test
39-
working-directory: ${{runner.workspace}}/build
40-
env:
41-
CTEST_OUTPUT_ON_FAILURE: True
42-
run: |
43-
ctest -C ${{matrix.build_type}}
34+
- name: CMake test
35+
run: ctest --test-dir build -C Release

0 commit comments

Comments
 (0)