Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma committed Feb 10, 2024
1 parent 4d935f1 commit ec8f941
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cmake-linux-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ on: [push, pull_request]

env:
BUILD_TYPE: RelWithDebInfo
CMAKE_BUILD_PARALLEL_LEVEL: 3

jobs:
build:
runs-on: ubuntu-latest
container: mrts/qt-cmake-gtest-valgrind-ubuntu:v1.8

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake libgtest-dev libpcsclite-dev

- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -S . -B build

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cmake-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request]

env:
BUILD_TYPE: RelWithDebInfo
CMAKE_BUILD_PARALLEL_LEVEL: 3
OPENSSL_ROOT_DIR: /usr/local/opt/openssl

jobs:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cmake-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request]

env:
BUILD_TYPE: RelWithDebInfo
CMAKE_BUILD_PARALLEL_LEVEL: 3

jobs:
build:
Expand All @@ -27,4 +28,4 @@ jobs:
run: cmake --build build --config ${env:BUILD_TYPE}

- name: Test
run: ctest -V -C ${env:BUILD_TYPE}--test-dir build
run: ctest -V -C ${env:BUILD_TYPE} --test-dir build
4 changes: 3 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
container: mrts/qt-cmake-gtest-valgrind-ubuntu:v1.8
permissions:
actions: read
contents: read
Expand All @@ -21,6 +20,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake libgtest-dev libpcsclite-dev

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8.0)
cmake_minimum_required(VERSION 3.16.0)
if(POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif()
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,22 @@ See more examples in [tests](tests).
## Building

apt install build-essential pkg-config cmake libgtest-dev valgrind libpcsclite-dev
sudo bash -c 'cd /usr/src/googletest && cmake . && cmake --build . --target install'

cd build
cmake .. # optionally with -DCMAKE_BUILD_TYPE=Debug
cmake --build . # optionally with VERBOSE=1
cmake -S . -B build # optionally with -DCMAKE_BUILD_TYPE=Debug
cmake --build build # optionally with VERBOSE=1

## Testing

Build as described above, then run inside `build` directory:

ctest # or 'valgrind --leak-check=full ctest'
ctest --test-dir build # or 'valgrind --leak-check=full ctest --test-dir build'

`ctest` runs tests that use the _libscard-mock_ library to mock PC/SC API calls.

There are also integration tests that use the real operating system PC/SC
service, run them inside `build` directory with:

./libpcsc-cpp-test-integration
./build/libpcsc-cpp-test-integration

## Development guidelines

Expand Down

0 comments on commit ec8f941

Please sign in to comment.