forked from nautechsystems/nautilus_trader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sccache in CI (nautechsystems#2093)
- Loading branch information
Showing
4 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,13 @@ jobs: | |
python-version: ["3.11", "3.12"] | ||
name: build - Python ${{ matrix.python-version }} (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
RUSTC_WRAPPER: "sccache" | ||
CC: "sccache clang" | ||
CXX: "sccache clang" | ||
|
||
steps: | ||
- name: Free disk space (Ubuntu) | ||
|
@@ -35,6 +42,9 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set up Rust toolchain | ||
run: | | ||
rustup toolchain add --profile minimal stable --component clippy,rustfmt | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,12 @@ jobs: | |
env: | ||
BUILD_MODE: debug | ||
RUST_BACKTRACE: 1 | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
RUSTC_WRAPPER: "sccache" | ||
CC: "sccache clang" | ||
CXX: "sccache clang" | ||
|
||
services: | ||
redis: | ||
|
@@ -60,6 +66,9 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set up Rust toolchain | ||
run: | | ||
rustup toolchain add --profile minimal stable --component clippy,rustfmt | ||
|
@@ -186,11 +195,23 @@ jobs: | |
env: | ||
BUILD_MODE: debug | ||
RUST_BACKTRACE: 1 | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set sccache-cache env vars (Windows) | ||
run: | | ||
echo RUSTC_WRAPPER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
echo CMAKE_C_COMPILER_LAUNCHER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
echo CMAKE_CXX_COMPILER_LAUNCHER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
- name: Free disk space (Windows) | ||
run: | | ||
rm -rf "/c/Program Files/dotnet" | ||
|
@@ -288,11 +309,20 @@ jobs: | |
env: | ||
BUILD_MODE: debug | ||
RUST_BACKTRACE: 1 | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
RUSTC_WRAPPER: "sccache" | ||
CC: "sccache clang" | ||
CXX: "sccache clang" | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Free disk space (macOS) | ||
run: | | ||
sudo rm -rf ~/Library/Caches/* | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,13 @@ jobs: | |
python-version: ["3.11"] | ||
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
RUSTC_WRAPPER: "sccache" | ||
CC: "sccache clang" | ||
CXX: "sccache clang" | ||
services: | ||
redis: | ||
image: redis | ||
|
@@ -52,6 +59,9 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set up Rust toolchain | ||
run: | | ||
rustup toolchain add --profile minimal stable --component clippy,rustfmt | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,10 @@ jobs: | |
shell: bash | ||
name: test-pip-install - Python ${{ matrix.python-version }} (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
|
||
steps: | ||
- name: Free disk space (Ubuntu) | ||
|
@@ -50,6 +54,23 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set sccache-cache env vars (non-Windows) | ||
if: runner.os != 'Windows' | ||
run: | | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
echo "CC=sccache clang" >> $GITHUB_ENV | ||
echo "CXX=sccache clang" >> $GITHUB_ENV | ||
- name: Set sccache-cache env vars (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
echo RUSTC_WRAPPER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
echo CMAKE_C_COMPILER_LAUNCHER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
echo CMAKE_CXX_COMPILER_LAUNCHER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
- name: Set up Rust toolchain | ||
run: | | ||
rustup toolchain add --profile minimal stable --component clippy,rustfmt | ||
|
@@ -81,6 +102,13 @@ jobs: | |
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create-release.outputs.upload_url }} | ||
env: | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
RUSTC_WRAPPER: "sccache" | ||
CC: "sccache clang" | ||
CXX: "sccache clang" | ||
|
||
steps: | ||
- name: Free disk space (Ubuntu) | ||
|
@@ -103,6 +131,9 @@ jobs: | |
with: | ||
fetch-depth: 2 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set up Rust toolchain | ||
run: | | ||
rustup toolchain add --profile minimal stable --component clippy,rustfmt | ||
|
@@ -173,6 +204,12 @@ jobs: | |
runs-on: ubuntu-latest | ||
env: | ||
COPY_TO_SOURCE: false # Do not copy built *.so files back into source tree | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
RUSTC_WRAPPER: "sccache" | ||
CC: "sccache clang" | ||
CXX: "sccache clang" | ||
|
||
steps: | ||
- name: Free disk space (Ubuntu) | ||
|
@@ -192,6 +229,9 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set up Rust toolchain | ||
run: | | ||
rustup toolchain add --profile minimal stable --component clippy,rustfmt | ||
|
@@ -272,6 +312,9 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
env: | ||
BUILD_MODE: release | ||
# https://github.com/Mozilla-Actions/sccache-action | ||
SCCACHE_GHA_ENABLED: "true" | ||
SCCACHE_CACHE_MULTIARCH: 1 | ||
|
||
steps: | ||
- name: Free disk space (Ubuntu) | ||
|
@@ -299,6 +342,23 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set sccache-cache env vars (non-Windows) | ||
if: runner.os != 'Windows' | ||
run: | | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
echo "CC=sccache clang" >> $GITHUB_ENV | ||
echo "CXX=sccache clang" >> $GITHUB_ENV | ||
- name: Set sccache-cache env vars (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
echo RUSTC_WRAPPER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
echo CMAKE_C_COMPILER_LAUNCHER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
echo CMAKE_CXX_COMPILER_LAUNCHER="${{ env.SCCACHE_PATH }}" >> $GITHUB_ENV | ||
- name: Set up Rust toolchain | ||
run: | | ||
rustup toolchain add --profile minimal stable --component clippy,rustfmt | ||
|