fix: subscriptions with free trial in ECE #3663
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: QIT Security and Malware Tests | |
| on: | |
| pull_request | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| qit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout repository" | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| - name: "Set up repository" | |
| uses: ./.github/actions/setup-repo | |
| - name: "Build the plugin" | |
| id: build_plugin | |
| uses: ./.github/actions/build | |
| - name: Install PHP & Composer | |
| run: sudo apt-get update && sudo apt-get install -y php-cli php-zip unzip | |
| - name: Install QIT CLI | |
| run: composer global require woocommerce/qit-cli | |
| - name: Authenticate QIT | |
| run: qit partner:add --user='${{ secrets.QIT_CI_USER }}' --application_password='${{ secrets.QIT_CI_SECRET }}' | |
| - name: Run Security Test | |
| run: | | |
| set +e | |
| qit run:security woocommerce-payments --zip=woocommerce-payments.zip --wait | |
| EXIT_CODE=$? | |
| # QIT exit codes (v0.10.0): | |
| # 0 = success | |
| # 1 = failed (critical security errors) | |
| # 2 = warning (non-critical issues) | |
| if [ $EXIT_CODE -eq 1 ]; then | |
| echo "Security test failed with critical errors." | |
| exit 1 | |
| elif [ $EXIT_CODE -eq 2 ]; then | |
| echo "Security test completed with warnings (non-critical issues). CI will pass." | |
| exit 0 | |
| elif [ $EXIT_CODE -ne 0 ]; then | |
| echo "Security test failed with unexpected exit code $EXIT_CODE." | |
| exit 1 | |
| fi | |
| echo "Security test passed successfully." | |
| - name: Run Malware Test | |
| run: | | |
| set +e | |
| qit run:malware woocommerce-payments --zip=woocommerce-payments.zip --wait | |
| EXIT_CODE=$? | |
| # QIT exit codes (v0.10.0): | |
| # 0 = success | |
| # 1 = failed (critical malware detected) | |
| # 2 = warning | |
| if [ $EXIT_CODE -eq 1 ]; then | |
| echo "Malware test failed." | |
| exit 1 | |
| elif [ $EXIT_CODE -eq 2 ]; then | |
| echo "Malware test completed with warnings. CI will pass." | |
| exit 0 | |
| elif [ $EXIT_CODE -ne 0 ]; then | |
| echo "Malware test failed with unexpected exit code $EXIT_CODE." | |
| exit 1 | |
| fi | |
| echo "Malware test passed successfully." |