Skip to content

Commit 4cc01cb

Browse files
committed
fix(ci): parameterise test.yml
1 parent 4be65c4 commit 4cc01cb

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/publish-cli.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env:
1111
jobs:
1212
test:
1313
uses: ./.github/workflows/test.yml
14+
with:
15+
package: cambridge-asm-cli
1416

1517
publish:
1618
name: Publish crate

.github/workflows/publish-lib.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env:
1111
jobs:
1212
test:
1313
uses: ./.github/workflows/test.yml
14+
with:
15+
package: cambridge-asm
1416

1517
publish:
1618
name: Publish lib

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- "lib/**"
1313
- "cli/**"
1414
workflow_call:
15+
inputs:
16+
package:
17+
type: string
1518

1619
env:
1720
CARGO_TERM_COLOR: always
@@ -21,6 +24,8 @@ jobs:
2124
name: Test
2225
runs-on: ubuntu-latest
2326
container: ghcr.io/saadisave/cambridge-asm-ci:latest
27+
env:
28+
package-arg: ${{ format('{0}{1}', inputs.package != '' && '-p ' || '', inputs.package) }}
2429

2530
steps:
2631
- uses: actions/checkout@v3
@@ -29,10 +34,10 @@ jobs:
2934
run: cargo fmt --check
3035

3136
- name: Run clippy
32-
run: cargo hack --feature-powerset clippy
37+
run: cargo hack ${{ env.package-arg }} --feature-powerset clippy
3338

3439
- name: Run in debug mode
35-
run: cargo hack test --feature-powerset && cargo hack build --feature-powerset
40+
run: cargo hack test ${{ env.package-arg }} --feature-powerset && cargo hack build ${{ env.package-arg }} --feature-powerset
3641

3742
- name: Run in release mode
38-
run: cargo hack test --release --feature-powerset && cargo hack build --release --feature-powerset
43+
run: cargo hack test ${{ env.package-arg }} --release --feature-powerset && cargo hack build ${{ env.package-arg }} --release --feature-powerset

0 commit comments

Comments
 (0)