Skip to content

Commit aad4be6

Browse files
authored
chore: add GitHub cache in CI (#28)
Use GitHub cache for sccache Use GitHub groups
1 parent d1e57a1 commit aad4be6

File tree

2 files changed

+58
-8
lines changed

2 files changed

+58
-8
lines changed

.github/workflows/deploy-gh-pages.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ jobs:
2424
DOC_DIR: doc
2525

2626
steps:
27-
- name: Checkout code
27+
- name: Checkout
2828
uses: actions/checkout@v4
2929

3030
- name: Setup Pages
3131
uses: actions/configure-pages@v4
3232

3333
- name: Setup Zola
34-
run: curl -s -L https://github.com/getzola/zola/releases/download/v${{ env.ZOLA_VERSION }}/zola-v${{ env.ZOLA_VERSION }}-x86_64-unknown-linux-gnu.tar.gz | sudo tar xvzf - -C /usr/local/bin
34+
run: |
35+
curl -s -L https://github.com/getzola/zola/releases/download/v${{ env.ZOLA_VERSION }}/zola-v${{ env.ZOLA_VERSION }}-x86_64-unknown-linux-gnu.tar.gz | sudo tar xvzf - -C /usr/local/bin
3536
shell: bash
3637

3738
- name: Build GitHub Pages

.github/workflows/rust-compiler-builder.yml

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
# https://github.com/actions/runner-images/tree/main/images/macos
5353
# https://developer.apple.com/support/xcode/
5454

55-
# Regression: arm64e-apple-darwin
5655
# Regression: macos-14 arm64
5756

5857
- rust-targets: x86_64-apple-darwin,aarch64-apple-darwin,aarch64-apple-ios,arm64e-apple-darwin,arm64e-apple-ios
@@ -73,6 +72,9 @@ jobs:
7372

7473
runs-on: ${{ matrix.os }}
7574
env:
75+
# Tools
76+
SCCACHE_GHA_ENABLED: 'on'
77+
# The Rust Compiler
7678
BOOTSTRAP_SKIP_TARGET_SANITY: 1 # TODO: disable BOOTSTRAP_SKIP_TARGET_SANITY when the 1.83 rustc is available
7779
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }}
7880
IPHONEOS_DEPLOYMENT_TARGET: ${{ matrix.iphoneos_deployment_target }}
@@ -83,7 +85,14 @@ jobs:
8385
RUST_VERBOSE: ${{ github.event.inputs.rust-verbose || '0' }}
8486

8587
steps:
86-
- name: Install Xcode ${{ matrix.xcode-version }}
88+
- name: Configure Cache Env
89+
uses: actions/github-script@v7
90+
with:
91+
script: |
92+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
93+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
94+
95+
- name: Select Xcode ${{ matrix.xcode-version }}
8796
run: |
8897
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app
8998
sudo xcode-select -p
@@ -101,17 +110,51 @@ jobs:
101110
102111
- name: Show System Info
103112
run: |
104-
echo ${PATH}
113+
114+
echo "::group::uname"
105115
uname -a
106-
xcodebuild -version
107-
xcrun --show-sdk-path
116+
echo "::endgroup::"
117+
118+
echo "::group::env"
119+
env
120+
echo "::endgroup::"
121+
122+
echo "::group::disk space"
123+
df -h .
124+
echo "::endgroup::"
125+
126+
echo "::group::sccache"
108127
sccache --version
128+
sccache --show-stats
129+
echo "::endgroup::"
130+
131+
echo "::group::cmake"
109132
cmake --version
133+
echo "::endgroup::"
134+
135+
echo "::group::ninja"
110136
ninja --version
137+
echo "::endgroup::"
138+
139+
echo "::group::xcodebuild"
140+
xcodebuild -version
141+
echo "::endgroup::"
142+
143+
echo "::group::xcrun"
144+
xcrun --show-sdk-path
145+
echo "::endgroup::"
146+
147+
echo "::group::clang"
111148
clang -v
149+
echo "::endgroup::"
150+
151+
echo "::group::ld"
112152
ld -v
153+
echo "::endgroup::"
154+
155+
echo "::group::lld"
113156
lld -flavor ld --version
114-
df -h .
157+
echo "::endgroup::"
115158
116159
- name: Checkout
117160
uses: actions/checkout@v4
@@ -155,3 +198,9 @@ jobs:
155198
with:
156199
name: rust-${{ env.RUST_CHANNEL }}-${{ matrix.rust-targets }}-${{ matrix.xcode-version }}-spec
157200
path: ./*.json
201+
202+
- name: Show Build Stats
203+
run: |
204+
echo "::group::sccache"
205+
sccache --show-stats
206+
echo "::endgroup::"

0 commit comments

Comments
 (0)