Remove APT cache step in workflows #37
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - '**/*.cpp' | |
| - '**/*.hpp' | |
| - 'cmake/**' | |
| - 'CMakeLists.txt' | |
| - 'CMakePresets.json' | |
| - '.github/workflows/ci.yml' | |
| pull_request: | |
| branches: [ master ] | |
| paths: | |
| - '**/*.cpp' | |
| - '**/*.hpp' | |
| - 'cmake/**' | |
| - 'CMakeLists.txt' | |
| - 'CMakePresets.json' | |
| - '.github/workflows/ci.yml' | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| name: ${{ matrix.compiler }}-${{ matrix.build_type }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| compiler: [gcc, clang] | |
| build_type: [Sanitize, Release] | |
| env: | |
| CMAKE_C_COMPILER_LAUNCHER: ccache | |
| CMAKE_CXX_COMPILER_LAUNCHER: ccache | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: { fetch-depth: 0 } | |
| - name: Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: ^3.28.0 | |
| ninjaVersion: ^1.11.0 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get -qq update | |
| sudo apt-get -qq install -y clang lld gcc g++ ccache --no-install-recommends | |
| - name: Cache ccache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ github.workspace }}/.ccache | |
| key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ hashFiles('CMakeLists.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-ccache- | |
| - name: Cache build directory | |
| uses: actions/cache@v3 | |
| with: | |
| path: build/ | |
| key: ${{ runner.os }}-build-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-build- | |
| - name: Configure with CMake Preset | |
| run: cmake --preset ${{ matrix.compiler }}-${{ matrix.build_type }} | |
| - name: Build (Ninja) | |
| run: cmake --build --preset ${{ matrix.compiler }}-${{ matrix.build_type }} | |
| - name: Run tests (ctest) | |
| run: ctest --preset ${{ matrix.compiler }}-${{ matrix.build_type }} |