Skip to content

Commit 73b46a6

Browse files
authored
Issue 437: Speed up github actions and uses new tool features. (#429)
Speed up github actions by taking advantage of new tool features Signed-off-by: SaiCharan <kotlasaicharan@yahoo.com>
1 parent b4e22d4 commit 73b46a6

File tree

4 files changed

+84
-119
lines changed

4 files changed

+84
-119
lines changed

.github/workflows/cibuild.yml

Lines changed: 54 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
tags:
88
- '*'
99
branches:
10-
- master
10+
- master
1111
pull_request:
1212
branches:
1313
- master
@@ -25,33 +25,21 @@ jobs:
2525

2626
- name: Display Rust version
2727
run: rustc --version
28-
- name: Cache toolchain
29-
uses: actions/cache@v3
30-
with:
31-
path: /usr/share/rust/.cargo
32-
key: ${{ runner.os }}-rustup
33-
- name: Cache cargo registry
34-
uses: actions/cache@v3
35-
with:
36-
path: ~/.cargo/registry
37-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
38-
- name: Cache cargo index
39-
uses: actions/cache@v3
40-
with:
41-
path: ~/.cargo/git
42-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
43-
- name: Cache cargo build
44-
uses: actions/cache@v3
45-
with:
46-
path: target
47-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
48-
4928
- name: Install stable toolchain
5029
uses: actions-rs/toolchain@v1
5130
with:
5231
toolchain: stable
53-
override: true
32+
default: true
5433
components: rustfmt, clippy
34+
- uses: actions/cache@v3
35+
with:
36+
path: |
37+
~/.cargo/bin/
38+
~/.cargo/registry/index/
39+
~/.cargo/registry/cache/
40+
~/.cargo/git/db/
41+
target/
42+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
5543

5644
- name: Run cargo check
5745
uses: actions-rs/cargo@v1
@@ -69,44 +57,30 @@ jobs:
6957
- name: Maximize disk space
7058
uses: easimon/maximize-build-space@master
7159
with:
72-
remove-android: true
73-
remove-haskell: true
74-
remove-dotnet: true
60+
remove-docker-images: true
7561
- name: Set up JDK 11
7662
uses: actions/setup-java@v1
7763
with:
7864
java-version: 11
7965

8066
- name: Checkout sources
8167
uses: actions/checkout@v2
82-
83-
- name: Cache toolchain
84-
uses: actions/cache@v3
85-
with:
86-
path: /usr/share/rust/.cargo
87-
key: ${{ runner.os }}-rustup
88-
- name: Cache cargo registry
89-
uses: actions/cache@v3
90-
with:
91-
path: ~/.cargo/registry
92-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
93-
- name: Cache cargo index
94-
uses: actions/cache@v3
95-
with:
96-
path: ~/.cargo/git
97-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
98-
- name: Cache cargo build
99-
uses: actions/cache@v3
100-
with:
101-
path: target
102-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
103-
10468
- name: Install stable toolchain
10569
uses: actions-rs/toolchain@v1
10670
with:
10771
toolchain: stable
108-
override: true
72+
default: true
10973
components: rustfmt, clippy
74+
- uses: actions/cache@v3
75+
with:
76+
path: |
77+
~/.cargo/bin/
78+
~/.cargo/registry/index/
79+
~/.cargo/registry/cache/
80+
~/.cargo/git/db/
81+
target/
82+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
83+
11084
- name: Run cargo test
11185
uses: actions-rs/cargo@v1
11286
with:
@@ -125,34 +99,21 @@ jobs:
12599
steps:
126100
- name: Checkout sources
127101
uses: actions/checkout@v2
128-
129-
- name: Cache toolchain
130-
uses: actions/cache@v3
131-
with:
132-
path: /usr/share/rust/.cargo
133-
key: ${{ runner.os }}-rustup
134-
- name: Cache cargo registry
135-
uses: actions/cache@v3
136-
with:
137-
path: ~/.cargo/registry
138-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
139-
- name: Cache cargo index
140-
uses: actions/cache@v3
141-
with:
142-
path: ~/.cargo/git
143-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
144-
- name: Cache cargo build
145-
uses: actions/cache@v3
146-
with:
147-
path: target
148-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
149-
150102
- name: Install stable toolchain
151103
uses: actions-rs/toolchain@v1
152104
with:
153105
toolchain: stable
154-
override: true
106+
default: true
155107
components: rustfmt, clippy
108+
- uses: actions/cache@v3
109+
with:
110+
path: |
111+
~/.cargo/bin/
112+
~/.cargo/registry/index/
113+
~/.cargo/registry/cache/
114+
~/.cargo/git/db/
115+
target/
116+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
156117

157118
- name: Run cargo fmt
158119
uses: actions-rs/cargo@v1
@@ -166,42 +127,23 @@ jobs:
166127
name: Clippy
167128
runs-on: ubuntu-latest
168129
steps:
169-
- name: Maximize disk space
170-
uses: easimon/maximize-build-space@master
171-
with:
172-
remove-android: true
173-
remove-haskell: true
174-
remove-dotnet: true
175130
- name: Checkout sources
176131
uses: actions/checkout@v2
177-
178-
- name: Cache toolchain
179-
uses: actions/cache@v3
180-
with:
181-
path: /usr/share/rust/.cargo
182-
key: ${{ runner.os }}-rustup
183-
- name: Cache cargo registry
184-
uses: actions/cache@v3
185-
with:
186-
path: ~/.cargo/registry
187-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
188-
- name: Cache cargo index
189-
uses: actions/cache@v3
190-
with:
191-
path: ~/.cargo/git
192-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
193-
- name: Cache cargo build
194-
uses: actions/cache@v3
195-
with:
196-
path: target
197-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
198-
199132
- name: Install stable toolchain
200133
uses: actions-rs/toolchain@v1
201134
with:
202135
toolchain: stable
203-
override: true
136+
default: true
204137
components: rustfmt, clippy
138+
- uses: actions/cache@v3
139+
with:
140+
path: |
141+
~/.cargo/bin/
142+
~/.cargo/registry/index/
143+
~/.cargo/registry/cache/
144+
~/.cargo/git/db/
145+
target/
146+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
205147

206148
- name: Run cargo clean
207149
uses: actions-rs/cargo@v1
@@ -220,7 +162,7 @@ jobs:
220162

221163
build-release:
222164
name: build-release
223-
needs: ['clippy', 'fmt', 'check', 'test']
165+
needs: ['fmt', 'check']
224166
runs-on: ${{ matrix.os }}
225167
env:
226168
# For some builds, we use cross to test on 32-bit and big-endian
@@ -280,10 +222,17 @@ jobs:
280222
uses: actions-rs/toolchain@v1
281223
with:
282224
toolchain: ${{ matrix.rust }}
283-
override: true
225+
default: true
284226
target: ${{ matrix.target }}
285-
components: rustfmt, clippy
286-
227+
- uses: actions/cache@v3
228+
with:
229+
path: |
230+
~/.cargo/bin/
231+
~/.cargo/registry/index/
232+
~/.cargo/registry/cache/
233+
~/.cargo/git/db/
234+
target/
235+
key: cross-${{ matrix.build }}-cargo-${{ hashFiles('**/Cargo.lock') }}
287236
- name: Use Cross
288237
shell: bash
289238
# // Changed cargo version from latest to 0.2.4 for more information please refer https://github.com/cross-rs/cross/issues/1214

.github/workflows/nodejs_test.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ jobs:
2424
- 20
2525
steps:
2626
- uses: actions/checkout@v2
27+
- name: Install stable toolchain
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
toolchain: stable
31+
default: true
32+
- uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.cargo/bin/
36+
~/.cargo/registry/index/
37+
~/.cargo/registry/cache/
38+
~/.cargo/git/db/
39+
target/
40+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2741
- uses: actions/setup-java@v1
2842
with:
2943
java-version: "11" # The JDK version to make available on the path.
@@ -41,12 +55,6 @@ jobs:
4155
- name: Install modules
4256
working-directory: ./nodejs
4357
run: npm i
44-
- name: Install stable toolchain
45-
uses: actions-rs/toolchain@v1
46-
with:
47-
toolchain: stable
48-
override: true
49-
components: rustfmt, clippy
5058
- name: Test
5159
working-directory: ./nodejs
5260
run: npm test

.github/workflows/publish_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
- name: Install cargo-release
4343
run: cargo install cargo-release
4444
- name: Release (Dry Run)
45-
run: cargo release --allow-branch '*' --dry-run -v -p pravega-client-shared -p pravega-client-macros -p pravega-client-channel -p pravega-client-retry -p pravega-connection-pool -p pravega-client-config -p pravega-wire-protocol -p pravega-controller-client -p pravega-client-auth
45+
run: cargo release --allow-branch '*' --dry-run -v --unpublished -p pravega-client-shared -p pravega-client-macros -p pravega-client-channel -p pravega-client-retry -p pravega-connection-pool -p pravega-client-config -p pravega-wire-protocol -p pravega-controller-client -p pravega-client-auth
4646
- name: Release
47-
run: cargo release --allow-branch '*' -x --no-confirm -v -p pravega-client-shared -p pravega-client-macros -p pravega-client-channel -p pravega-client-retry -p pravega-connection-pool -p pravega-client-config -p pravega-wire-protocol -p pravega-controller-client -p pravega-client-auth
47+
run: cargo release --allow-branch '*' -x --no-confirm -v --unpublished -p pravega-client-shared -p pravega-client-macros -p pravega-client-channel -p pravega-client-retry -p pravega-connection-pool -p pravega-client-config -p pravega-wire-protocol -p pravega-controller-client -p pravega-client-auth
4848
env:
4949
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
5050

.github/workflows/python_test.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ jobs:
1818
timeout-minutes: 25
1919
steps:
2020
- uses: actions/checkout@v2
21+
- name: Install stable toolchain
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: stable
25+
default: true
26+
- uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/.cargo/bin/
30+
~/.cargo/registry/index/
31+
~/.cargo/registry/cache/
32+
~/.cargo/git/db/
33+
target/
34+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2135
- uses: actions/setup-java@v1
2236
with:
2337
java-version: '11' # The JDK version to make available on the path.
@@ -32,12 +46,6 @@ jobs:
3246
uses: actions/setup-python@v3
3347
with:
3448
python-version: 3.7
35-
- name: Install stable toolchain
36-
uses: actions-rs/toolchain@v1
37-
with:
38-
toolchain: stable
39-
override: true
40-
components: rustfmt, clippy
4149
- name: Install maturin and tox
4250
run: pip install 'maturin>=0.14,<0.15' virtualenv tox==3.28.0 tox-pyo3
4351
- name: Test with tox

0 commit comments

Comments
 (0)