Skip to content

Commit ebe6b90

Browse files
committed
workflow: make build/test faster and consume less space
1 parent 99c4155 commit ebe6b90

File tree

6 files changed

+34
-12
lines changed

6 files changed

+34
-12
lines changed

.github/workflows/_docs_release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
environment: docs-release
1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
1618
- uses: actions/setup-node@v4
1719
with:
1820
cache: yarn

.github/workflows/_test.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,19 @@ jobs:
2121
- { runner: macos-13, python_exec: ".venv/bin/python" }
2222
- { runner: windows-latest, python_exec: ".venv\\Scripts\\python" }
2323
runs-on: ${{ matrix.platform.runner }}
24+
env:
25+
RUSTFLAGS: "-C debuginfo=0 -C split-debuginfo=off"
26+
CARGO_INCREMENTAL: "0"
27+
SCCACHE_GHA_ENABLED: "true"
28+
RUSTC_WRAPPER: "sccache"
29+
2430
steps:
2531
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 1
34+
35+
- name: Run sccache-cache
36+
uses: mozilla-actions/[email protected]
2637

2738
- uses: actions/setup-python@v5
2839
id: setup_python
@@ -31,23 +42,13 @@ jobs:
3142
cache: 'pip'
3243

3344
- run: rustup toolchain install stable --profile minimal
34-
- name: Rust Cache
35-
uses: Swatinem/rust-cache@v2
36-
with:
37-
key: rust-${{ matrix.platform.runner }}-${{ matrix.python-version }}
45+
3846
- name: Rust tests (no default features)
3947
run: cargo test --no-default-features --verbose
4048

4149
- name: Rust tests
4250
run: cargo test --verbose
4351

44-
- uses: actions/cache@v4
45-
with:
46-
path: .venv
47-
key: pyenv-${{ matrix.platform.runner }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}
48-
restore-keys: |
49-
pyenv-${{ matrix.platform.runner }}-${{ steps.setup_python.outputs.python-version }}-
50-
5152
- name: Setup venv
5253
run: |
5354
python -m venv .venv
@@ -56,7 +57,7 @@ jobs:
5657
${{ matrix.platform.python_exec }} -m pip install maturin mypy pytest pytest-asyncio
5758
- name: Python build
5859
run: |
59-
${{ matrix.platform.python_exec }} -m maturin develop -E all
60+
${{ matrix.platform.python_exec }} -m maturin develop --strip -E all
6061
- name: Python type check (mypy)
6162
run: |
6263
${{ matrix.platform.python_exec }} -m mypy python
@@ -68,6 +69,8 @@ jobs:
6869
runs-on: ubuntu-latest
6970
steps:
7071
- uses: actions/checkout@v4
72+
with:
73+
fetch-depth: 1
7174
- name: Install Rust toolchain
7275
uses: dtolnay/rust-toolchain@stable
7376
- uses: taiki-e/install-action@v2

.github/workflows/docs_test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 1
1820
- uses: actions/setup-node@v4
1921
with:
2022
cache: yarn

.github/workflows/format.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 1
3234
- uses: dtolnay/rust-toolchain@stable
3335
with:
3436
components: rustfmt
@@ -41,6 +43,8 @@ jobs:
4143
runs-on: ubuntu-latest
4244
steps:
4345
- uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 1
4448
- uses: actions/setup-python@v5
4549
with:
4650
python-version: 3.11

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 1
2224
- run: ./.github/scripts/update_version.sh
2325
- uses: actions/upload-artifact@v4
2426
with:
@@ -30,6 +32,8 @@ jobs:
3032
needs: [create-versioned-toml]
3133
steps:
3234
- uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 1
3337
- uses: actions/download-artifact@v4
3438
with:
3539
name: Cargo.toml
@@ -61,6 +65,8 @@ jobs:
6165
- { os: windows, runner: windows-latest, target: x64 }
6266
steps:
6367
- uses: actions/checkout@v4
68+
with:
69+
fetch-depth: 1
6470
- uses: actions/download-artifact@v4
6571
with:
6672
name: Cargo.toml
@@ -107,6 +113,8 @@ jobs:
107113
needs: [create-versioned-toml, generate-3p-notices]
108114
steps:
109115
- uses: actions/checkout@v4
116+
with:
117+
fetch-depth: 1
110118
- uses: actions/download-artifact@v4
111119
with:
112120
name: Cargo.toml
@@ -138,6 +146,8 @@ jobs:
138146
environment: release
139147
steps:
140148
- uses: actions/checkout@v4
149+
with:
150+
fetch-depth: 1
141151
- uses: actions/download-artifact@v4
142152
with:
143153
name: Cargo.toml

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ license = "Apache-2.0"
99

1010
[profile.release]
1111
codegen-units = 1
12+
strip = "symbols"
1213
lto = true
1314

1415
[lib]

0 commit comments

Comments
 (0)