2020 runs-on : ${{ matrix.os }}
2121 env :
2222 IN_CI : ' 1'
23+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
24+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
25+ SCCACHE_BUCKET : ' pyoxidizer-sccache'
26+ SCCACHE_S3_USE_SSL : ' 1'
2327 steps :
2428 - name : Install Linux system packages
25- if : ${{ runner.os == 'Linux' }}
29+ if : runner.os == 'Linux'
2630 run : |
2731 sudo apt-get install -y libyaml-dev snapcraft
2832
@@ -44,17 +48,67 @@ jobs:
4448 profile : minimal
4549 target : x86_64-unknown-linux-musl
4650
51+ - name : Cache sccache (Windows)
52+ id : cache-sccache-windows
53+ if : runner.os == 'Windows'
54+ uses : actions/cache@v2
55+ with :
56+ path : C:/Rust/.cargo/bin/sccache.exe
57+ key : ${{ runner.os }}-sccache-0
58+
59+ - name : Install sccache build dependencies (Windows)
60+ if : runner.os == 'Windows' && steps.cache-sccache-windows.outputs.cache-hit != 'true'
61+ run : |
62+ vcpkg integrate install
63+ vcpkg install openssl:x64-windows
64+
65+ - name : Install sccache (Linux)
66+ if : runner.os == 'Linux'
67+ run : |
68+ wget -O sccache.tar.gz https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-unknown-linux-musl.tar.gz
69+ tar -xvzf sccache.tar.gz
70+ mv sccache-0.2.13-x86_64-unknown-linux-musl/sccache /usr/share/rust/.cargo/bin/sccache
71+
72+ - name : Install sccache (macOS)
73+ if : runner.os == 'macOS'
74+ run : |
75+ wget -O sccache.tar.gz https://github.com/mozilla/sccache/releases/download/0.2.13/sccache-0.2.13-x86_64-apple-darwin.tar.gz
76+ tar -xvzf sccache.tar.gz
77+ mv sccache-0.2.13-x86_64-apple-darwin/sccache /Users/runner/.cargo/bin/sccache
78+
79+ - name : Install sccache (Windows)
80+ if : steps.cache-sccache-windows.outputs.cache-hit != 'true' && runner.os == 'Windows'
81+ # sccache doesn't work with Rust 1.48. https://github.com/mozilla/sccache/issues/887
82+ run : |
83+ rustup install 1.47.0
84+ cargo +1.47.0 install --features 'azure s3' sccache
85+
86+ - name : Start sccache
87+ run : |
88+ sccache --start-server
89+
4790 # TODO get pyembed working. It needs a working libpython.
4891 - name : Build Workspace
92+ env :
93+ RUSTC_WRAPPER : sccache
4994 run : |
5095 cargo build --workspace --exclude pyembed --exclude oxidized-importer
5196 cargo run --bin pyoxidizer -- --version
5297
5398 - name : Test Workspace
99+ env :
100+ RUSTC_WRAPPER : sccache
54101 run : |
55102 cargo test --workspace --exclude pyembed --exclude oxidized-importer
56103
57104 - name : Run Clippy
58105 if : ${{ matrix.rust_toolchain == 'stable' || matrix.rust_toolchain == 'beta' }}
106+ env :
107+ RUSTC_WRAPPER : sccache
59108 run : |
60109 cargo clippy --workspace --exclude pyembed --exclude oxdized-importer
110+
111+ - name : Stop sccache
112+ run : |
113+ sccache --show-stats
114+ sccache --stop-server
0 commit comments