Skip to content

Commit 4c0a7a1

Browse files
committed
Update workflows
Update `.github/workflows/linux.yml` Update `.github/workflows/linux.yml` Fix typo in `.github/workflows/linux.yml` Update workflows. Update windows workflow
1 parent c81f756 commit 4c0a7a1

File tree

3 files changed

+58
-78
lines changed

3 files changed

+58
-78
lines changed

.github/workflows/linux.yml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,28 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: [ubuntu-22.04]
14-
compiler: [g++-9, g++-10, clang++-17]
15-
build_type: [Debug, Release]
16-
standard: [20]
13+
os: [ubuntu-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+
1726
steps:
1827
- name: Checkout
19-
uses: actions/[email protected]
20-
21-
- name: Create Environment
22-
run: |
23-
sudo apt update
24-
sudo apt install -y g++-9 g++-10
25-
wget https://apt.llvm.org/llvm.sh; chmod u+x llvm.sh; sudo ./llvm.sh 17
26-
cmake -E make_directory ${{runner.workspace}}/build
28+
uses: actions/checkout@v4
2729

28-
- name: Configure
29-
working-directory: ${{runner.workspace}}/build
30-
env:
31-
CXX: ${{ matrix.compiler }}
32-
run: |
33-
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
3432

35-
- name: Build
36-
working-directory: ${{runner.workspace}}/build
37-
run: |
38-
cpus=`nproc`
39-
cmake --build . --config ${{matrix.build_type}} --parallel $cpus
33+
- name: CMake build
34+
run: cmake --build build
4035

41-
- name: Test
42-
working-directory: ${{runner.workspace}}/build
43-
env:
44-
CTEST_OUTPUT_ON_FAILURE: True
45-
run: |
46-
ctest -C ${{matrix.build_type}}
36+
- name: CMake test
37+
run: ctest --test-dir build

.github/workflows/macos.yml

Lines changed: 20 additions & 23 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
18-
uses: actions/[email protected]
19-
20-
- name: Create Environment
21-
run: |
22-
cmake -E make_directory ${{runner.workspace}}/build
28+
uses: actions/checkout@v4
2329

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: 18 additions & 26 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++20", "/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
19-
uses: actions/[email protected]
20-
21-
- name: Create Environment
22-
run: |
23-
cmake -E make_directory ${{runner.workspace}}/build
26+
uses: actions/checkout@v4
2427

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)