Skip to content

Modified: Caching dependencies to speed up the workflow #12

Modified: Caching dependencies to speed up the workflow

Modified: Caching dependencies to speed up the workflow #12

Workflow file for this run

name: CMake Continuous Integration
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true # This ensures that the googletest submodule is also checked out
- name: Cache snappy dependencies
id: cache-snappy
uses: actions/cache@v2
with:
path: /usr/local/snappy
key: ${{ runner.os }}-snappy-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-snappy-
- name: Install snappy dependencies if not cached
if: steps.cache-snappy.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y libsnappy-dev
- name: Cache CMake build
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-cmake-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-cmake-
- name: Configure CMake
run: mkdir build && cd build && cmake -DUSE_SUBMODULE_GTEST=ON ..
- name: Build
run: cd build && make
- name: Run tests
run: cd build && ./run_tests