From f17f1cde1e16ac12f64e041d8814dfa38dab6f7b Mon Sep 17 00:00:00 2001 From: Florian Franzen Date: Wed, 3 Jul 2024 16:55:57 +0200 Subject: [PATCH] ci: fix cargo test commands --- .github/actions/cargo-command/action.yaml | 4 ++-- .github/workflows/merge-pages-docs.yaml | 2 +- .github/workflows/pr-build-docs.yaml | 2 +- .github/workflows/pr-build-runtime.yaml | 1 - .github/workflows/pr-test-cargo.yaml | 10 +++++++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/actions/cargo-command/action.yaml b/.github/actions/cargo-command/action.yaml index c6ed7287c6..7d1033bd42 100644 --- a/.github/actions/cargo-command/action.yaml +++ b/.github/actions/cargo-command/action.yaml @@ -6,7 +6,7 @@ inputs: required: false default: 'build' package: - description: 'Limit execution to a specific package' + description: 'Limit execution to a specific package, assumes workspace if unset' required: false profile: description: 'Profile under which to run cargo command' @@ -52,4 +52,4 @@ runs: env: CARGO_TERM_COLOR: always shell: bash - run: cargo ${{ inputs.command }} ${{ inputs.package != '' && '--package' || '' }} ${{ inputs.package }} --profile '${{ inputs.profile }}' --features '${{ inputs.features }}' --message-format json ${{ inputs.args }} | cargo-action-fmt + run: cargo ${{ inputs.command }} ${{ inputs.package == '' && '--workspace' || '--package' }} ${{ inputs.package }} --profile '${{ inputs.profile }}' --features '${{ inputs.features }}' --message-format json ${{ inputs.args }} | cargo-action-fmt diff --git a/.github/workflows/merge-pages-docs.yaml b/.github/workflows/merge-pages-docs.yaml index 9c3f9ee2e6..0c4b8246ea 100644 --- a/.github/workflows/merge-pages-docs.yaml +++ b/.github/workflows/merge-pages-docs.yaml @@ -36,7 +36,7 @@ jobs: uses: ./.github/actions/cargo-command with: command: doc - args: --workspace --no-deps --document-private-items + args: --no-deps --document-private-items - name: Assemble structure env: DOCS_HIDEOUT: an8ohgahmoot6ro8ieReib9micau0Oow diff --git a/.github/workflows/pr-build-docs.yaml b/.github/workflows/pr-build-docs.yaml index f96d8a2189..f1707dc24b 100644 --- a/.github/workflows/pr-build-docs.yaml +++ b/.github/workflows/pr-build-docs.yaml @@ -30,7 +30,7 @@ jobs: uses: ./.github/actions/cargo-command with: command: doc - args: --workspace --no-deps --document-private-items + args: --no-deps --document-private-items - name: Upload docs uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/pr-build-runtime.yaml b/.github/workflows/pr-build-runtime.yaml index 92b259ef25..b0b0d2314d 100644 --- a/.github/workflows/pr-build-runtime.yaml +++ b/.github/workflows/pr-build-runtime.yaml @@ -35,7 +35,6 @@ jobs: uses: ./.github/actions/cargo-command with: package: ${{ matrix.package }} - profile: release features: ${{ matrix.features }} - name: Upload timechain runtime uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr-test-cargo.yaml b/.github/workflows/pr-test-cargo.yaml index 6e6bce5f25..679fbeb499 100644 --- a/.github/workflows/pr-test-cargo.yaml +++ b/.github/workflows/pr-test-cargo.yaml @@ -29,13 +29,14 @@ jobs: matrix: include: - command: clippy - args: --all-targets --workspace --examples --tests -- --no-deps -D warnings - - command: test - args: --workspace --locked + args: --all-targets --all-features --examples --tests -- --no-deps -D warnings - command: check features: runtime-benchmarks - command: check features: try-runtime + - command: test + args: --no-run + after: cargo test --workspace steps: - name: Checkout sources uses: actions/checkout@v4 @@ -47,3 +48,6 @@ jobs: command: ${{ matrix.command }} features: ${{ matrix.features }} args: ${{ matrix.args }} + - name: Run optional command + if: ${{ matrix.after != '' }} + run: ${{ matrix.after }}