From f9d2f12a2ba4c4bef60641cbeb464b58080df04a Mon Sep 17 00:00:00 2001 From: Hannes Rantzsch Date: Sun, 19 May 2024 11:22:36 +0200 Subject: [PATCH] update CI * add more targets * user runner.os * install gcovr with brew on macos * split test and cov, add schedule --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf2ad2e..654da4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,58 +5,78 @@ on: branches: [ master ] pull_request: branches: [ master ] + schedule: + - cron: '0 4 * * 0' jobs: Windows-test: - runs-on: windows-2022 + runs-on: [windows-2019, windows-2022] strategy: matrix: config: [Debug, Release] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run cmake run: cmake -G "Visual Studio 17" . -DBUILD_TESTS=yes -DCODE_COVERAGE=no - name: Build and run tests run: cmake --build . --target test --config ${{ matrix.config }} - Unix-test-and-cover: + Unix-test: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-14] - config: [Debug, Release, Coverage] + os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-11, macos-12, macos-13, macos-14] + config: [Debug, Release] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | - if [ "$RUNNER_OS" == "Linux" ]; then + if [ ${{ runner.os }} == 'Linux' ]; then sudo apt-get install dbus-x11 dbus gnome-keyring libsecret-1-dev gcovr - elif [ "$RUNNER_OS" == "macOS" ]; then - pip3 install gcovr + elif [ ${{ runner.os }} == 'macOS' ]; then + brew install gcovr fi - - name: "CMake: configure coverage" - if: matrix.config == 'Coverage' - run: cmake . -DBUILD_TESTS=yes -DCODE_COVERAGE=yes -DCMAKE_BUILD_TYPE=Debug - - name: "CMake: configure test" - if: matrix.config != 'Coverage' + - name: Run cmake run: cmake . -DBUILD_TESTS=yes -DCODE_COVERAGE=no -DCMAKE_BUILD_TYPE=${{ matrix.config }} - name: Build and run tests run: | - if [ "$RUNNER_OS" == "Linux" ]; then + if [ ${{ runner.os }} == 'Linux' ]; then + eval $(DISPLAY=:99.0 dbus-launch --sh-syntax) + echo "somepassword" | gnome-keyring-daemon -r -d --unlock + fi + cmake --build . --target test + + Unix-test-coverage: + runs-on: [ubuntu-22.04, macos-14] + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + if [ ${{ runner.os }} == 'Linux' ]; then + sudo apt-get install dbus-x11 dbus gnome-keyring libsecret-1-dev gcovr + elif [ ${{ runner.os }} == 'macOS' ]; then + brew install gcovr + fi + + - name: Run cmake + run: cmake . -DBUILD_TESTS=yes -DCODE_COVERAGE=yes -DCMAKE_BUILD_TYPE=Debug + + - name: Build and run tests + run: | + if [ ${{ runner.os }} == 'Linux' ]; then eval $(DISPLAY=:99.0 dbus-launch --sh-syntax) echo "somepassword" | gnome-keyring-daemon -r -d --unlock fi cmake --build . --target test - name: Generate gcovr report - if: matrix.config == 'Coverage' run: gcovr -r . -f "src/*" -f "include/*" -x -o coverage.xml - name: Upload coverage to Codecov - if: matrix.config == 'Coverage' uses: codecov/codecov-action@v3 with: file: ./coverage.xml