Skip to content

Commit 91eb244

Browse files
committed
Optimize build times attempt
1 parent f4e5f28 commit 91eb244

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,22 @@ jobs:
5252
strategy:
5353
fail-fast: false
5454
matrix:
55-
project:
55+
project:
56+
# TODO: remove the cargo_project_name and only use the name after renaming mithril-core name in its Cargo.toml
5657
- name: mithril-core
58+
cargo_project_name: mithril
5759
artefacts_pattern: libmithril
5860
- name: mithril-common
61+
cargo_project_name: mithril-common
5962
artefacts_pattern: libmithril_common
6063
- name: mithril-aggregator
64+
cargo_project_name: mithril-aggregator
6165
artefacts_pattern: mithril-aggregator
6266
- name: mithril-client
67+
cargo_project_name: mithril-client
6368
artefacts_pattern: mithril-client
6469
- name: mithril-signer
70+
cargo_project_name: mithril-signer
6571
artefacts_pattern: mithril-signer
6672
steps:
6773
- name: Checkout sources
@@ -92,32 +98,31 @@ jobs:
9298
uses: actions-rs/cargo@v1
9399
with:
94100
command: build
95-
args: --release --bins --lib --tests --manifest-path ./${{ matrix.project.name }}/Cargo.toml
101+
args: --release --bins --lib --tests --locked -p ${{ matrix.project.cargo_project_name }}
96102

97103
- name: Cargo check
98104
uses: actions-rs/cargo@v1
99105
with:
100106
command: check
101-
args: --release --all-targets --manifest-path ./${{ matrix.project.name }}/Cargo.toml
107+
args: --release --all-targets --locked -p ${{ matrix.project.cargo_project_name }}
102108

103109
- name: Cargo fmt
104110
uses: actions-rs/cargo@v1
105111
with:
106112
command: fmt
107-
args: --all --manifest-path ./${{ matrix.project.name }}/Cargo.toml -- --check
113+
args: --all -p ${{ matrix.project.cargo_project_name }}
108114

109115
- name: Clippy Check
110116
uses: actions-rs/clippy-check@v1
111117
with:
112118
name: clippy-${{ matrix.project.name }}
113119
token: ${{ secrets.GITHUB_TOKEN }}
114-
args: --release --manifest-path ./${{ matrix.project.name }}/Cargo.toml --all-features
120+
args: --release --all-features -p ${{ matrix.project.cargo_project_name }}
115121

116122
- name: Run cargo test
117123
shell: bash
118-
working-directory: ${{ matrix.project.name }}
119124
run: |
120-
set -o pipefail && cargo test --release -- -Z unstable-options --format json --report-time | tee >(cargo2junit > test-results-${{ matrix.project.name }}.xml)
125+
set -o pipefail && cargo test --release --locked -p ${{ matrix.project.cargo_project_name }} -- -Z unstable-options --format json --report-time | tee >(cargo2junit > test-results-${{ matrix.project.name }}.xml)
121126
122127
- name: Upload Unit Test Results
123128
if: always()
@@ -131,7 +136,7 @@ jobs:
131136
uses: actions-rs/cargo@v1
132137
with:
133138
command: doc
134-
args: --no-deps --release --manifest-path ./${{ matrix.project.name }}/Cargo.toml
139+
args: --no-deps --release -p ${{ matrix.project.cargo_project_name }}
135140

136141
- name: Publish ${{ matrix.project.name }}
137142
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)