Skip to content

Commit d1d4923

Browse files
committed
Remove the prebuild step since it doens't bring much improvements
Signed-off-by: DJO <[email protected]>
1 parent afb9558 commit d1d4923

File tree

1 file changed

+10
-48
lines changed

1 file changed

+10
-48
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,9 @@ name: CI
44
on: [push]
55

66
jobs:
7-
prebuild:
8-
if: github.event.pull_request.draft == false
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout sources
12-
uses: actions/checkout@v2
13-
14-
- name: Install stable toolchain
15-
uses: actions-rs/toolchain@v1
16-
with:
17-
profile: minimal
18-
toolchain: stable
19-
components: clippy, rustfmt
20-
override: true
21-
22-
- uses: actions/cache@v3
23-
id: cargo-cache
24-
name: Cache Cargo.lock
25-
with:
26-
path: |
27-
~/.cargo/bin/
28-
~/.cargo/registry/index/
29-
~/.cargo/registry/cache/
30-
~/.cargo/git/db/
31-
target/
32-
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
33-
restore-keys: |
34-
${{ runner.os }}-key
35-
36-
- name: Install cargo tools
37-
if: ${{ steps.cargo-cache.outputs.cache-hit == false }}
38-
run: |
39-
cargo install cargo2junit 2>/dev/null || true # Suppress the "binary `cargo2junit` already exists in destination" error
40-
41-
- name: Cargo build
42-
if: ${{ steps.cargo-cache.outputs.cache-hit == false }}
43-
uses: actions-rs/cargo@v1
44-
with:
45-
command: build
46-
args: --release --workspace --all-targets
47-
487
build:
498
if: github.event.pull_request.draft == false
509
runs-on: ubuntu-latest
51-
needs: [ prebuild ]
5210
strategy:
5311
fail-fast: false
5412
matrix:
@@ -86,19 +44,23 @@ jobs:
8644
with:
8745
path: |
8846
~/.cargo/bin/
89-
~/.cargo/registry/index/
90-
~/.cargo/registry/cache/
91-
~/.cargo/git/db/
47+
~/.cargo/registry/
48+
~/.cargo/git/
9249
target/
93-
key: ${{ runner.os }}-${{ hashFiles('/Cargo.lock') }}
50+
key: cargo-${{ runner.os }}-${{ matrix.project.name }}-${{ hashFiles('Cargo.lock') }}
9451
restore-keys: |
95-
${{ runner.os }}-key
52+
${{ runner.os }}-${{ matrix.project.name }}-key
53+
54+
- name: Install cargo tools
55+
if: ${{ steps.cargo-cache.outputs.cache-hit == false }}
56+
run: |
57+
cargo install cargo2junit 2>/dev/null || true # Suppress the "binary `cargo2junit` already exists in destination" error
9658
9759
- name: Cargo build
9860
uses: actions-rs/cargo@v1
9961
with:
10062
command: build
101-
args: --release --bins --lib --tests -p ${{ matrix.project.cargo_project_name }}
63+
args: --release --all-targets -p ${{ matrix.project.cargo_project_name }}
10264

10365
- name: Cargo check
10466
uses: actions-rs/cargo@v1

0 commit comments

Comments
 (0)