Add tests to workflow pipeline
This commit is contained in:
parent
fe6d88306f
commit
41c02daac3
1 changed files with 36 additions and 0 deletions
36
.forgejo/workflows/build_and_test.yml
Normal file
36
.forgejo/workflows/build_and_test.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake build-essential
|
||||
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
- name: Build project
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --parallel $(nproc)
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd build
|
||||
ctest --output-on-failure --parallel $(nproc)
|
Loading…
Add table
Add a link
Reference in a new issue