@@ -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,34 +98,33 @@ 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 -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
102-
103- - name : Cargo fmt
104- uses : actions-rs/cargo@v1
105- with :
106- command : fmt
107- args : --all --manifest-path ./${{ matrix.project.name }}/Cargo.toml -- --check
107+ args : --release --all-targets -p ${{ matrix.project.cargo_project_name }}
108108
109109 - name : Clippy Check
110110 uses : actions-rs/clippy-check@v1
111111 with :
112112 name : clippy-${{ matrix.project.name }}
113113 token : ${{ secrets.GITHUB_TOKEN }}
114- args : --release --manifest-path ./${{ matrix.project.name }}/Cargo.toml --all-features
114+ args : --release --all-features -p ${{ matrix.project.cargo_project_name }}
115+
116+ - name : Cargo fmt
117+ uses : actions-rs/cargo@v1
118+ with :
119+ command : fmt
120+ args : --all -p ${{ matrix.project.cargo_project_name }}
115121
116- - name : Run cargo test
122+ - name : Run tests
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 -p ${{ matrix.project.cargo_project_name }} - - -Z unstable-options --format json --report-time | tee >(cargo2junit > test-results-${{ matrix.project.name }}.xml)
121126
122- - name : Upload Unit Test Results
127+ - name : Upload Tests Results
123128 if : always()
124129 uses : actions/upload-artifact@v3
125130 with :
@@ -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