Skip to content

Commit

Permalink
ci: Accelerated compilation (OpenAtomFoundation#2706)
Browse files Browse the repository at this point in the history
  • Loading branch information
baerwang authored Jun 7, 2024
1 parent 5240e45 commit 38eb16d
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions .github/workflows/pika.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,20 @@ jobs:
with:
go-version: 1.19

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.13
with:
key: ubuntu-latest

- name: Install Deps
if: ${{ steps.cache.output.cache-hit != 'true' }}
run: |
sudo apt-get install -y autoconf libprotobuf-dev protobuf-compiler
sudo apt-get install -y clang-tidy-12
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address

- name: Cache Build
uses: actions/cache@v3
id: cache-ubuntu
with:
key: ${{ runner.os }}-build-ubuntu-${{ hashFiles('**/CMakeLists.txt') }}
path: |
${{ github.workspace }}/buildtrees
${{ github.workspace }}/deps
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache

- name: Build
# Build your program with the given configuration
Expand Down Expand Up @@ -166,25 +161,21 @@ jobs:
with:
go-version: 1.19

- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.13
with:
key: macos-12

- name: Install Deps
run: |
brew update
brew install --overwrite python@3.12 autoconf protobuf llvm wget git
brew install gcc@10 automake cmake make binutils
- name: Configure CMake
run: |
export CC=/usr/local/opt/gcc@10/bin/gcc-10
cmake -B build -DCMAKE_C_COMPILER=/usr/local/opt/gcc@10/bin/gcc-10 -DUSE_PIKA_TOOLS=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/deps
key: ${{ runner.os }}-deps-${{ hashFiles('**/CMakeLists.txt') }}

- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/buildtrees
key: ${{ runner.os }}-buildtrees-${{ hashFiles('**/CMakeLists.txt') }}
cmake -B build -DCMAKE_C_COMPILER=/usr/local/opt/gcc@10/bin/gcc-10 -DUSE_PIKA_TOOLS=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: |
Expand Down

0 comments on commit 38eb16d

Please sign in to comment.