Skip to content

Commit

Permalink
feat: add workflow to build agent on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jr0me committed Aug 13, 2024
1 parent 5fa3e5b commit b3efe49
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/actions/compile/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ inputs:
runs:
using: "composite"
steps:
- name: Compile
- name: Generate CMake project
run: |
SRC_FOLDER=$(pwd)/src
VERSION=$(cat src/VERSION)
echo $VERSION
REVISION=$(cat src/REVISION)
echo $REVISION
SRC_FOLDER=$(pwd)/${{ inputs.path }}
cd ${{ inputs.path }}
mkdir -p build && cd build
cmake -DSRC_FOLDER=${SRC_FOLDER} -DVERSION="$VERSION" -DREVISION="$REVISION" .. && make -j2
cmake ${SRC_FOLDER} -DBUILD_TESTS=1 -G Ninja
shell: bash

- name: Compile
run: |
cmake --build .
shell: bash

- name: Run Tests
run: |
ctest
shell: bash
27 changes: 27 additions & 0 deletions .github/workflows/compile_and_run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Compile and Run Tests

on:
push:
branches:
- '**'
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
compile:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Run Compile Action
uses: ./.github/actions/compile
with:
path: src/

0 comments on commit b3efe49

Please sign in to comment.