From 8a6813f2429fe2f2eb1613d74bd06a62aea402d8 Mon Sep 17 00:00:00 2001 From: neargye Date: Sat, 27 May 2023 14:07:42 +0400 Subject: [PATCH] update ci --- .github/workflows/macos.yml | 10 ++++++---- .github/workflows/ubuntu.yml | 20 +++++++++++--------- .github/workflows/windows.yml | 15 ++++++++------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 303fec0..c786fc8 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -2,9 +2,11 @@ name: macos on: [push, pull_request] +permissions: read-all + jobs: build: - runs-on: ${{matrix.config.os}} + runs-on: ${{ matrix.config.os }} strategy: fail-fast: false matrix: @@ -12,7 +14,7 @@ jobs: - { os: macos-11 } # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md#xcode - { os: macos-12 } # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md#xcode - name: "${{matrix.config.os}}" + name: "${{ matrix.config.os }}" steps: - uses: actions/checkout@v3 @@ -22,7 +24,7 @@ jobs: mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release - cmake --build . --config Release + cmake --build . -j 4 --config Release ctest --output-on-failure -C Release - name: Build Debug @@ -31,5 +33,5 @@ jobs: mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Debug - cmake --build . --config Debug + cmake --build . -j 4 --config Debug ctest --output-on-failure -C Debug diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index fd3e091..78a70d0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -2,6 +2,8 @@ name: ubuntu on: [push, pull_request] +permissions: read-all + jobs: ubuntu: runs-on: ubuntu-20.04 @@ -21,13 +23,13 @@ jobs: - { cc: "clang-15", cxx: "clang++-15" } - { cc: "clang-16", cxx: "clang++-16" } - name: "${{matrix.compiler.cc}}" + name: "${{ matrix.compiler.cc }}" steps: - uses: actions/checkout@v3 - name: Configure clang run: | - if [[ "${{matrix.compiler.cc}}" == "clang"* ]]; then + if [[ "${{ matrix.compiler.cc }}" == "clang"* ]]; then wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-9 main" sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" @@ -39,15 +41,15 @@ jobs: sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main" sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" sudo apt update - sudo apt install ${{matrix.compiler.cc}} -y + sudo apt install ${{ matrix.compiler.cc }} -y fi - name: Configure gcc run: | - if [[ "${{matrix.compiler.cc}}" == "gcc"* ]]; then + if [[ "${{ matrix.compiler.cc }}" == "gcc"* ]]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt update - sudo apt install ${{matrix.compiler.cxx}} -y + sudo apt install ${{ matrix.compiler.cxx }} -y fi - name: Build Release @@ -55,8 +57,8 @@ jobs: rm -rf build mkdir build cd build - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} - cmake --build . --config Release + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} + cmake --build . -j 4 --config Release ctest --output-on-failure -C Release - name: Build Debug @@ -64,6 +66,6 @@ jobs: rm -rf build mkdir build cd build - cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} - cmake --build . --config Debug + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} + cmake --build . -j 4 --config Debug ctest --output-on-failure -C Debug diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c65377b..491f069 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -2,9 +2,11 @@ name: windows on: [push, pull_request] +permissions: read-all + jobs: build: - runs-on: ${{matrix.config.os}} + runs-on: ${{ matrix.config.os }} strategy: fail-fast: false matrix: @@ -12,7 +14,7 @@ jobs: - { os: windows-2019, vs: "Visual Studio 2019" } # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#visual-studio-enterprise-2019 - { os: windows-2022, vs: "Visual Studio 2022" } # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md#visual-studio-enterprise-2022 - name: "${{matrix.config.vs}}" + name: "${{ matrix.config.vs }}" steps: - uses: actions/checkout@v3 @@ -23,9 +25,9 @@ jobs: mkdir build cd build cmake .. -A Win32 - cmake --build . --config Release + cmake --build . -j 4 --config Release ctest --output-on-failure -C Release - cmake --build . --config Debug + cmake --build . -j 4 --config Debug ctest --output-on-failure -C Debug - name: Build x64 @@ -35,8 +37,7 @@ jobs: mkdir build cd build cmake .. -A x64 - cmake --build . --config Release + cmake --build . -j 4 --config Release ctest --output-on-failure -C Release - cmake --build . --config Debug + cmake --build . -j 4 --config Debug ctest --output-on-failure -C Debug -