Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
329 changes: 329 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,335 @@ jobs:
${SCCACHE_PATH} --show-stats
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"

gcc:
runs-on: ubuntu-24.04
needs: build

env:
SCCACHE_GHA_ENABLED: "on"
SCCACHE_SERVER_UDS: "/home/runner/sccache.socket"

steps:
- uses: actions/checkout@v5

- name: Configure Cache Env
uses: actions/github-script@v8
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')

- uses: actions/download-artifact@v5
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x ${SCCACHE_PATH}

- name: Test C/C++
run: |
export CXX="${SCCACHE_PATH} g++"
$CXX -c `pwd`/tests/test_clang_multicall.c

- name: Output
run: |
${SCCACHE_PATH} --show-stats

- name: Test Twice for Cache Read
run: |
export CXX="${SCCACHE_PATH} g++"
$CXX -c `pwd`/tests/test_clang_multicall.c

- name: Output
run: |
${SCCACHE_PATH} --show-stats

${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"

- name: Test ASM
run: |
export ASM="${SCCACHE_PATH} gcc"
$ASM -c `pwd`/tests/test_intel_asm.s

- name: Test ASM with preprocessor
run: |
export ASM="${SCCACHE_PATH} gcc"
$ASM -c `pwd`/tests/test_intel_asm_to_preproc.S

autotools:
runs-on: ubuntu-24.04
needs: build

env:
SCCACHE_GHA_ENABLED: "on"

steps:
- uses: actions/checkout@v5

- name: Configure Cache Env
uses: actions/github-script@v8
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')

- uses: actions/download-artifact@v5
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x ${SCCACHE_PATH}

- name: Install dependencies
shell: bash
run: |
## Install dependencies
sudo apt-get update
sudo apt-get install autoconf automake libtool

- name: Test
run: |
cd `pwd`/tests/autotools/
autoreconf||true
automake --add-missing
./configure CXX="${SCCACHE_PATH} g++"
make

- name: Output
run: |
${SCCACHE_PATH} --show-stats

- name: Test Twice for Cache Read
run: |
cd `pwd`/tests/autotools/
make distclean
./configure CXX="${SCCACHE_PATH} g++"
make

- name: Output
run: |
${SCCACHE_PATH} --show-stats

${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"

cmake:
runs-on: ubuntu-24.04
needs: build

env:
SCCACHE_GHA_ENABLED: "on"

steps:
- uses: actions/checkout@v5

- name: Configure Cache Env
uses: actions/github-script@v8
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')

- uses: actions/download-artifact@v5
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x ${SCCACHE_PATH}

- name: Install dependencies
shell: bash
run: |
## Install dependencies
sudo apt-get update
sudo apt-get install cmake

- name: Test
run: |
cd `pwd`/tests/cmake/
mkdir build
cd build
cmake -DCMAKE_C_COMPILER_LAUNCHER=${SCCACHE_PATH} -DCMAKE_CXX_COMPILER_LAUNCHER=${SCCACHE_PATH} ..
make

- name: Output
run: |
${SCCACHE_PATH} --show-stats

- name: Test Twice for Cache Read
run: |
cd `pwd`/tests/cmake/
rm -rf build
mkdir build
cd build
cmake -DCMAKE_C_COMPILER_LAUNCHER=${SCCACHE_PATH} -DCMAKE_CXX_COMPILER_LAUNCHER=${SCCACHE_PATH} ..
make

- name: Output
run: |
${SCCACHE_PATH} --show-stats

${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"

cmake-modules:
runs-on: ubuntu-24.04
needs: build

env:
SCCACHE_GHA_ENABLED: "on"
LLVM_VERSION: "19"

steps:
- uses: actions/checkout@v5

- name: Configure Cache Env
uses: actions/github-script@v8
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')

- uses: actions/download-artifact@v5
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x ${SCCACHE_PATH}

- name: Install dependencies
shell: bash
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh "${LLVM_VERSION}"
sudo apt-get update
sudo apt-get install -y ninja-build
pip install cmake

- name: Test
run: |
cd `pwd`/tests/cmake-modules/
cmake -B build -G Ninja \
-DCMAKE_C_COMPILER=clang-${LLVM_VERSION} \
-DCMAKE_CXX_COMPILER=clang++-${LLVM_VERSION} \
-DCMAKE_C_COMPILER_LAUNCHER=${SCCACHE_PATH} \
-DCMAKE_CXX_COMPILER_LAUNCHER=${SCCACHE_PATH}
cmake --build build

- name: Output
run: |
${SCCACHE_PATH} --show-stats

- name: Test Twice for Cache Read
run: |
cd `pwd`/tests/cmake-modules/
rm -rf build
cmake -B build -G Ninja \
-DCMAKE_C_COMPILER=clang-${LLVM_VERSION} \
-DCMAKE_CXX_COMPILER=clang++-${LLVM_VERSION} \
-DCMAKE_C_COMPILER_LAUNCHER=${SCCACHE_PATH} \
-DCMAKE_CXX_COMPILER_LAUNCHER=${SCCACHE_PATH}
cmake --build build

- name: Output
run: |
${SCCACHE_PATH} --show-stats

${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"

# Test sccache with modern LLVM-based code coverage
rust-test-coverage:
runs-on: ubuntu-24.04
needs: build

env:
RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"

steps:
- name: Clone repository
uses: actions/checkout@v5

- name: Install rust
uses: ./.github/actions/rust-toolchain
with:
toolchain: "stable"

- uses: actions/download-artifact@v5
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x ${SCCACHE_PATH}

- name: "Coverage test #1"
run: cargo clean && cargo build

- name: Output
run: |
${SCCACHE_PATH} --show-stats

- name: "Coverage test #2"
run: cargo clean && cargo build

- name: Output
run: |
${SCCACHE_PATH} --show-stats

${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"

zstd-compression-level:
runs-on: ubuntu-24.04
needs: build

env:
RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache
SCCACHE_DIR:
CARGO_INCREMENTAL: "0"

steps:
- uses: actions/download-artifact@v5
with:
name: integration-tests
path: /home/runner/.cargo/bin/
- name: Chmod for binary
run: chmod +x ${SCCACHE_PATH}

- name: Clone repository
uses: actions/checkout@v5

- name: Install rust
uses: ./.github/actions/rust-toolchain
with:
toolchain: "stable"

- name: default-test-save
run: |
export SCCACHE_DIR=${PWD}/temp-test/zstd-level/default
cargo build
- name: default-stats-save
run: ${SCCACHE_PATH} --show-stats
- name: default-test-use
run: |
cargo clean && cargo build
- name: default-stats-use
run: ${SCCACHE_PATH} --show-stats
- name: lv10-test-save
run: |
export SCCACHE_DIR=${PWD}/temp-test/zstd-level/10
export SCCACHE_CACHE_ZSTD_LEVEL=10
${SCCACHE_PATH} --stop-server > /dev/null
cargo clean
cargo build
- name: lv10-stats-save
run: ${SCCACHE_PATH} --show-stats
- name: lv10-test-use
run: |
cargo clean && cargo build
- name: lv10-stats-use
run: ${SCCACHE_PATH} --show-stats

xcode:
runs-on: macos-latest
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ tests/**/Cargo.lock

.direnv/
result
.vscode/settings.json
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,22 @@ Known Caveats

[More details on Rust caveats](/docs/Rust.md)

### C++20 Modules

sccache has partial support for C++20 named modules when using **Clang**. The following flags are supported:

* `-fmodule-file=<path>` and `-fmodule-file=<name>=<path>` - importing precompiled module interfaces
* `-fmodule-output=<path>` - generating module interface output alongside object files
* `--precompile` - compiling module interface units
* `-fmodules-reduced-bmi` - generating reduced BMI files

The following module-related flags are **not supported** and will bypass the cache:

* `-fmodules` and `-fcxx-modules` - Clang header modules (not C++20 named modules)
* `-fprebuilt-implicit-modules` and `-fprebuilt-module-path` - implicit module discovery

**GCC** and **MSVC** C++20 modules are not yet supported. Compilations using `-fmodules-ts` (GCC) or `/interface`, `/ifcOutput`, etc. (MSVC) will bypass the cache.

### User Agent

* Requests sent to your storage option of choice will have a user agent header indicating the current sccache version, e.g. `sccache/0.8.2`.
Expand Down
Loading
Loading