Skip to content

Commit

Permalink
Merge pull request #7 from chien-liu/workflow
Browse files Browse the repository at this point in the history
Add CI workflow
  • Loading branch information
chien liu authored Oct 23, 2023
2 parents 9016cc7 + c3cf432 commit 8e117bc
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/cpp_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: C/C++ CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: CMake config
run: |
mkdir ${{ github.workspace }}/build
cd ${{ github.workspace }}/build
cmake .. -DTEST=ON
- name: CMake build
run: |
cd ${{ github.workspace }}/build
cmake --build .
- uses: actions/upload-artifact@v3
with:
name: unittest-artifects
path: ${{ github.workspace }}/build/unittest
retention-days: 1

unittest:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4
- name: Create directory for unittest executable
run: mkdir ${{ github.workspace }}/bin
- uses: actions/download-artifact@v3
with:
name: unittest-artifects
path: ${{ github.workspace }}/bin/
- name: Run unittest
run: |
cd ${{ github.workspace }}/bin
chmod +x unittest
./unittest
16 changes: 16 additions & 0 deletions .github/workflows/test-clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: test-clang-format

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: DoozyX/[email protected]
with:
source: '.'
extensions: 'h,cpp'
clangFormatVersion: 10
style: llvm

0 comments on commit 8e117bc

Please sign in to comment.