Skip to content

Commit

Permalink
ci: add GitHub Actions workflow for build and test automation
Browse files Browse the repository at this point in the history
  • Loading branch information
milliCoulomb committed Dec 29, 2024
1 parent 117bb0e commit 287ba5b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
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

0 comments on commit 287ba5b

Please sign in to comment.