Skip to content

Commit 9f0eb1a

Browse files
authored
Merge pull request #17 from CleanCut/sccache-windows
Use sccache on Windows
2 parents 2e3b2f8 + 2babab5 commit 9f0eb1a

File tree

2 files changed

+21
-49
lines changed

2 files changed

+21
-49
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,18 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [macos-latest, windows-latest, ubuntu-latest]
23-
toolchain: [stable, beta, nightly]
23+
toolchain: [stable]
2424
include:
2525
- os: macos-latest
2626
MACOS: true
27-
sccache-path: /Users/runner/Library/Caches/Mozilla.sccache
28-
sccache-download-target: apple-darwin
29-
# This can be moved to the "env:" section below once sccache is also working on Windows
30-
rustc_wrapper: sccache
3127
- os: windows-latest
3228
- os: ubuntu-latest
33-
sccache-path: /home/runner/.cache/sccache
34-
sccache-download-target: unknown-linux-musl
35-
# This can be moved to the "env:" section below once sccache is also working on Windows
36-
rustc_wrapper: sccache
3729
env:
3830
RUST_BACKTRACE: full
39-
#RUSTC_WRAPPER: sccache # Can't hard-code this until we've got Windows working, too
40-
RUSTC_WRAPPER: ${{ matrix.rustc_wrapper }}
4131
RUSTV: ${{ matrix.toolchain }}
42-
SCCACHE_CACHE_SIZE: 2G
43-
SCCACHE_DIR: ${{ matrix.sccache-path }}
44-
SCCACHE_TARGET: ${{ matrix.sccache-download-target }}
45-
URL_BASE: https://github.com/mozilla/sccache/releases/download
46-
SCCACHE_VERSION: v0.2.15
47-
# SCCACHE_RECACHE: 1 # Uncomment this to clear cache, then comment it back out
4832
steps:
4933
- uses: actions/checkout@v2
5034

51-
- name: Install sccache
52-
run: |
53-
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-$SCCACHE_TARGET
54-
mkdir -p $HOME/.local/bin
55-
curl -L "$URL_BASE/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
56-
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
57-
chmod +x $HOME/.local/bin/sccache
58-
echo "$HOME/.local/bin" >> $GITHUB_PATH
59-
if: matrix.os != 'windows-latest'
60-
6135
- name: Install Linux deps alsa and udev
6236
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
6337
if: runner.os == 'linux'
@@ -72,31 +46,32 @@ jobs:
7246
override: true
7347

7448
- name: Fetch cargo registry cache
75-
uses: actions/cache@v2
49+
uses: actions/cache@v3
7650
continue-on-error: false
7751
with:
7852
path: |
79-
~/.cargo/registry
80-
~/.cargo/git
53+
~/.cargo/bin/
54+
~/.cargo/registry/index/
55+
~/.cargo/registry/cache/
56+
~/.cargo/git/db/
57+
target/
8158
Cargo.lock
82-
key: ${{ runner.os }}-cargo-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
83-
restore-keys: |
84-
${{ runner.os }}-cargo-${{ matrix.toolchain }}-
85-
if: matrix.os != 'windows-latest'
59+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
60+
if: runner.os != 'windows'
8661

87-
- name: Fetch sccache cache
88-
uses: actions/cache@v2
62+
- name: Fetch cargo registry cache (windows)
63+
uses: actions/cache@v3
8964
continue-on-error: false
9065
with:
91-
path: ${{ matrix.sccache-path }}
92-
key: ${{ runner.os }}-sccache-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
93-
restore-keys: |
94-
${{ runner.os }}-sccache-${{ matrix.toolchain }}-
95-
if: matrix.os != 'windows-latest'
96-
97-
- name: Start sccache server
98-
run: sccache --start-server
99-
if: matrix.os != 'windows-latest'
66+
path: |
67+
C:\Rust\.cargo\bin
68+
C:\Rust\.cargo\registry\index
69+
C:\Rust\.cargo\registry\cache
70+
C:\Rust\.cargo\git\db
71+
target
72+
Cargo.lock
73+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
74+
if: runner.os == 'windows'
10075

10176
- name: rustfmt & clippy
10277
run: |
@@ -108,7 +83,3 @@ jobs:
10883
- run: cargo test --workspace --all-targets --all-features
10984
env:
11085
MACOS: ${{ matrix.MACOS }} # Used by some tests
111-
112-
- name: Stop sccache server
113-
run: sccache --stop-server || true
114-
if: matrix.os != 'windows-latest'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Fixed `CollisionPair::either_contains` to use `.contains` instead of `==`, contributed by [@etnt](https://github.com/etnt) in [#51](https://github.com/CleanCut/rusty_engine/pull/51)
77
- Added `CollisionPair::either_equals_to` which uses `==`, contributed by [@etnt](https://github.com/etnt) in [#51](https://github.com/CleanCut/rusty_engine/pull/51)
88
- Fixed documentation for a few fields of the `Engine` struct which were in the wrong place.
9+
- Improved CI caching. Builds should now generally complete in under 3 minutes.
910

1011
## [5.0.6] - 2022-05-19
1112

0 commit comments

Comments
 (0)