[PLUTO-1412] test init #99
Workflow file for this run
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: plugin it-test | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] # [windows-latest] removed for now | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed for git history | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| cache: true | |
| - name: Download CLI binaries from go workflow | |
| uses: dawidd6/action-download-artifact@v2 | |
| with: | |
| workflow: go.yml | |
| name: cli-binaries | |
| path: . | |
| - name: Select correct binary | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.os }}" = "windows-latest" ]; then | |
| # Keep the .exe extension for Windows | |
| echo "Using Windows binary with .exe extension" | |
| elif [ "${{ matrix.os }}" = "macos-latest" ]; then | |
| mv cli-v2-macos cli-v2 | |
| else | |
| mv cli-v2-linux cli-v2 | |
| fi | |
| - name: Make binary executable | |
| if: matrix.os != 'windows-latest' | |
| run: chmod +x cli-v2 | |
| - name: Run init command tests | |
| if: matrix.os != 'windows-latest' | |
| id: run_init_tests | |
| continue-on-error: true | |
| shell: bash | |
| env: | |
| CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }} | |
| run: | | |
| # Make the script executable | |
| chmod +x integration-tests/run.sh | |
| # Run the init command tests | |
| echo "Running init command integration tests..." | |
| ./integration-tests/run.sh || { | |
| echo "❌ Init command tests failed" | |
| echo "::error::Init command tests failed. Please check the logs above for details." | |
| exit 1 | |
| } | |
| echo "✅ Init command tests passed successfully!" | |
| - name: Run tool tests | |
| if: matrix.os != 'windows-latest' | |
| id: run_tests | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| # Make the script executable | |
| chmod +x run-tool-tests.sh | |
| # Initialize failed tools file | |
| rm -f /tmp/failed_tools.txt | |
| touch /tmp/failed_tools.txt | |
| # Run tests for each tool directory | |
| for tool_dir in plugins/tools/*/; do | |
| tool_name=$(basename "$tool_dir") | |
| if [ -d "$tool_dir/test/src" ]; then | |
| echo "Running tests for $tool_name..." | |
| ./run-tool-tests.sh "$tool_name" || { | |
| echo "❌ Test failed for $tool_name" | |
| echo "$tool_name" >> /tmp/failed_tools.txt | |
| } | |
| fi | |
| done | |
| # Check if any tools failed | |
| if [ -s /tmp/failed_tools.txt ] && [ "$(wc -l < /tmp/failed_tools.txt)" -gt 0 ]; then | |
| echo -e "\n❌ The following tools failed their tests:" | |
| cat /tmp/failed_tools.txt | |
| echo "::error::Some tool tests failed. Please check the logs above for details." | |
| exit 1 | |
| else | |
| echo "✅ All tool tests passed successfully!" | |
| fi | |
| - name: Check test results | |
| if: steps.run_tests.outcome == 'failure' || steps.run_init_tests.outcome == 'failure' | |
| run: | | |
| echo "Job failed because some tests failed. Please check the logs above for details." | |
| exit 1 |