Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoireW authored and pbeyssac committed Aug 16, 2024
1 parent c8dfd28 commit 7cff9b0
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: simple build and test

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install cmake libcyaml-dev libjson-c-dev libevent-dev lcov -y
- name: Create makefile
run: |
cmake -S . -B $(pwd)/cmake-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="--coverage" -DCMAKE_EXE_LINKER_FLAGS="--coverage"
- name: Build
run: |
cmake --build $(pwd)/cmake-build --config Release
#- name: Run tests
# run: |
# exec test
#

#- name: Generate coverage report
# run: |
# cd $(pwd)/cmake-build
# lcov --capture --directory . --output-file coverage.info
# lcov --remove coverage.info '/usr/*' --output-file coverage.info
# lcov --list coverage.info
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: simple build and test

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install cmake libcyaml-dev libjson-c-dev libevent-dev -y
- name: Create makefile
run: |
cmake -S . -B $(pwd)/cmake-build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cmake --build $(pwd)/cmake-build --config Release
- name: Upload release asset
env:
GH_TOKEN: ${{ github.token }}
run: |
mv $(pwd)/cmake-build/caster $(pwd)/cmake-build/caster-linux-x64
gh release upload ${{github.event.release.tag_name}} $(pwd)/cmake-build/caster-linux-x64

0 comments on commit 7cff9b0

Please sign in to comment.