-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add GitHub Actions workflow for build and test automation
- Loading branch information
1 parent
117bb0e
commit 287ba5b
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Cache apt packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: /var/cache/apt | ||
key: ${{ runner.os }}-apt-${{ hashFiles('apt-packages.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-apt- | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential cmake | ||
- name: Cache CMake | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cmake | ||
key: ${{ runner.os }}-cmake-${{ hashFiles('CMakeLists.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-cmake- | ||
- name: Configure and Build | ||
run: | | ||
mkdir -p build | ||
cd build | ||
cmake .. | ||
make | ||
- name: Run Unit Tests | ||
run: | | ||
cd build | ||
./tests/runTests |