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 : ' gregoryszorc-ci-pyoxidizer-sccache'
2326 steps :
2427 - name : Install Linux system packages
25- if : ${{ runner.os == 'Linux' }}
28+ if : runner.os == 'Linux'
2629 run : |
2730 sudo apt-get install -y libyaml-dev snapcraft
2831
@@ -44,17 +47,67 @@ jobs:
4447 profile : minimal
4548 target : x86_64-unknown-linux-musl
4649
50+ - name : Cache sccache (Windows)
51+ id : cache-sccache-windows
52+ if : runner.os == 'Windows'
53+ uses : actions/cache@v2
54+ with :
55+ path : C:/Rust/.cargo/bin/sccache.exe
56+ key : ${{ runner.os }}-sccache-0
57+
58+ - name : Install sccache build dependencies (Windows)
59+ if : runner.os == 'Windows' && steps.cache-sccache-windows.outputs.cache-hit != 'true'
60+ run : |
61+ vcpkg integrate install
62+ vcpkg install openssl:x64-windows
63+
64+ - name : Install sccache (Linux)
65+ if : runner.os == 'Linux'
66+ run : |
67+ 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
68+ tar -xvzf sccache.tar.gz
69+ mv sccache-0.2.13-x86_64-unknown-linux-musl/sccache /usr/share/rust/.cargo/bin/sccache
70+
71+ - name : Install sccache (macOS)
72+ if : runner.os == 'macOS'
73+ run : |
74+ 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
75+ tar -xvzf sccache.tar.gz
76+ mv sccache-0.2.13-x86_64-apple-darwin/sccache /Users/runner/.cargo/bin/sccache
77+
78+ - name : Install sccache (Windows)
79+ if : steps.cache-sccache-windows.outputs.cache-hit != 'true' && runner.os == 'Windows'
80+ # sccache doesn't work with Rust 1.48. https://github.com/mozilla/sccache/issues/887
81+ run : |
82+ rustup install 1.47.0
83+ cargo +1.47.0 install --features 'azure s3' sccache
84+
85+ - name : Start sccache
86+ run : |
87+ sccache --start-server
88+
4789 # TODO get pyembed working. It needs a working libpython.
4890 - name : Build Workspace
91+ env :
92+ RUSTC_WRAPPER : sccache
4993 run : |
5094 cargo build --workspace --exclude pyembed --exclude oxidized-importer
5195 cargo run --bin pyoxidizer -- --version
5296
5397 - name : Test Workspace
98+ env :
99+ RUSTC_WRAPPER : sccache
54100 run : |
55101 cargo test --workspace --exclude pyembed --exclude oxidized-importer
56102
57103 - name : Run Clippy
58104 if : ${{ matrix.rust_toolchain == 'stable' || matrix.rust_toolchain == 'beta' }}
105+ env :
106+ RUSTC_WRAPPER : sccache
59107 run : |
60108 cargo clippy --workspace --exclude pyembed --exclude oxdized-importer
109+
110+ - name : Stop sccache
111+ run : |
112+ sccache --show-stats
113+ sccache --stop-server
0 commit comments