Skip to content

Commit

Permalink
test something
Browse files Browse the repository at this point in the history
  • Loading branch information
hrantzsch committed May 21, 2024
1 parent 39d521c commit bc4b1fb
Showing 1 changed file with 52 additions and 31 deletions.
83 changes: 52 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,54 @@ jobs:
- name: Build and run tests
run: cmake --build . --target test --config ${{ matrix.config }}

unix-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
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@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
# unix-test:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-11, macos-12, macos-13, 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=no -DCMAKE_BUILD_TYPE=Release
#
# - 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: 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
eval $(DISPLAY=:99.0 dbus-launch --sh-syntax)
echo "somepassword" | gnome-keyring-daemon -r -d --unlock
fi
cmake --build . --target test
unix-test-coverage:
unix-test-and-coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-14]
os:
- {
image: ubuntu-20.04,
coverage: no
}
- {
image: macos-12,
coverage: no
}
- {
image: ubuntu-latest,
coverage: yes
}
- {
image: macos-latest,
coverage: yes
}
steps:
- uses: actions/checkout@v4

Expand All @@ -78,7 +93,10 @@ jobs:
fi
- name: Run cmake
run: cmake . -DBUILD_TESTS=yes -DCODE_COVERAGE=yes -DCMAKE_BUILD_TYPE=Debug
run: |
cmake . -DBUILD_TESTS=yes \
-DCODE_COVERAGE=${{ matrix.os.coverage }} \
-DCMAKE_BUILD_TYPE=${{ matrix.os.coverage == 'yes' && 'Debug' || 'Release' }}
- name: Build and run tests
run: |
Expand All @@ -89,9 +107,12 @@ jobs:
cmake --build . --target test
- name: Generate gcovr report
if: matrix.os.coverage == 'yes'
run: gcovr -r . -f "src/*" -f "include/*" -x -o coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.os.coverage == 'yes'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
Expand Down

0 comments on commit bc4b1fb

Please sign in to comment.