ci: fix path to unit test execution in GitHub Actions workflow #2
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
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 | |
./test/runTests |