adds github action
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
This commit is contained in:
58
.github/workflows/unit-tests.yml
vendored
Normal file
58
.github/workflows/unit-tests.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: CI Unit Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.cpp'
|
||||
- '**.h'
|
||||
- '**CMakeLists.txt'
|
||||
- '.github/workflows/**'
|
||||
- 'conanfile.py'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.cpp'
|
||||
- '**.h'
|
||||
- '**CMakeLists.txt'
|
||||
- '.github/workflows/**'
|
||||
- 'conanfile.py'
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: unit-tests (C++20)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout SystemC-Components-Test
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: true
|
||||
- name: Checkout SystemC-Components
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: Minres/SystemC-Components
|
||||
path: scc
|
||||
submodules: true
|
||||
- name: Cache Conan
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.conan2
|
||||
key: conan-${{ runner.os }}-unit-cpp20-${{ hashFiles('conanfile.py') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y g++ python3-pip cmake ninja-build
|
||||
pip3 install conan --break-system-packages
|
||||
cmake --version
|
||||
|
||||
- name: Configure
|
||||
run: >
|
||||
cmake --preset Debug -B build
|
||||
-DBUILD_TESTING=ON
|
||||
-DCMAKE_CXX_STANDARD=20
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build -j
|
||||
|
||||
- name: Run unit tests
|
||||
run: ctest --output-on-failure
|
||||
working-directory: build
|
||||
Reference in New Issue
Block a user