From 4324c2c9ad83d2b467fe380048e2b8c9146ced16 Mon Sep 17 00:00:00 2001 From: MahdiBM Date: Sun, 17 Nov 2024 22:36:24 +0330 Subject: [PATCH] enable release-mode tests in self-test --- .github/workflows/run-unit-tests.yml | 8 ++++---- .github/workflows/self-test.yml | 14 +++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index fbb3e4e..f398368 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -154,16 +154,16 @@ jobs: timeout-minutes: 60 steps: - name: Check out code - if: ${{ matrix.swift-config.build-mode == 'debug' || !inputs.with_release_mode_testing }} + if: ${{ matrix.swift-config.build-mode == 'debug' || inputs.with_release_mode_testing }} uses: actions/checkout@v4 - name: Check Swift compatibility id: swift-check - if: ${{ matrix.swift-config.build-mode == 'debug' || !inputs.with_release_mode_testing }} + if: ${{ matrix.swift-config.build-mode == 'debug' || inputs.with_release_mode_testing }} uses: vapor/ci/.github/actions/check-compatible-swift@main with: package_root: ${{ inputs.package_root }} - name: Run unit tests - if: ${{ steps.swift-check.outputs.swift-compatible == 'true' && (matrix.swift-config.build-mode == 'debug' || !inputs.with_release_mode_testing) }} + if: ${{ steps.swift-check.outputs.swift-compatible == 'true' && (matrix.swift-config.build-mode == 'debug' || inputs.with_release_mode_testing) }} run: | SWIFT_DETERMINISTIC_HASHING=1 \ swift test \ @@ -176,7 +176,7 @@ jobs: ${TEST_FILTER} \ ${EXTRA_FLAGS} - name: Upload coverage data - if: ${{ inputs.with_coverage && (steps.swift-check.outputs.swift-compatible == 'true') && (matrix.swift-config.build-mode == 'debug' || !inputs.with_release_mode_testing) }} + if: ${{ inputs.with_coverage && (steps.swift-check.outputs.swift-compatible == 'true') && (matrix.swift-config.build-mode == 'debug' || inputs.with_release_mode_testing) }} uses: vapor/swift-codecov-action@v0.3 with: codecov_token: ${{ secrets.CODECOV_TOKEN || '' }} diff --git a/.github/workflows/self-test.yml b/.github/workflows/self-test.yml index 34a10d5..56e9b35 100644 --- a/.github/workflows/self-test.yml +++ b/.github/workflows/self-test.yml @@ -2,6 +2,16 @@ name: Self-test the reusable workflow on: workflow_dispatch: inputs: + with_testing: + type: boolean + required: false + default: true + description: "Set to 'true' to enable compilation for testing and @testable imports. Defaults to 'true'." + with_release_mode_testing: + type: boolean + required: false + default: true + description: "Set to 'true' to enable testing in release mode as well. Defaults to 'false'." with_coverage: type: boolean required: false @@ -27,7 +37,7 @@ on: required: false default: true description: "Set to 'true' to run CodeQL checks. Defaults to 'true'." - with_linting: + with_linting: type: boolean required: false default: true @@ -57,6 +67,8 @@ jobs: call-workflow: uses: ./.github/workflows/run-unit-tests.yml with: + with_testing: ${{ inputs.with_testing || true }} + with_release_mode_testing: ${{ inputs.with_release_mode_testing || true }} with_coverage: ${{ inputs.with_coverage || false }} with_tsan: ${{ inputs.with_tsan || false }} with_api_check: ${{ inputs.with_api_check || true }}