chore(deps): bump actions/cache from 5 to 6 #184
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: Codacy Analysis | |
| on: | |
| push: | |
| branches: [ main, "**" ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| codacy-scan: | |
| name: Codacy Scan (generate SARIF) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Ensure wrapper executable | |
| run: | | |
| if [ -f ".codacy/cli.sh" ]; then chmod +x .codacy/cli.sh; fi | |
| - name: Download Codacy CLI | |
| run: | | |
| if [ -f ".codacy/cli.sh" ]; then bash ./.codacy/cli.sh download; else echo ".codacy/cli.sh not found"; exit 1; fi | |
| - name: Run Codacy analysis and collect SARIF | |
| env: | |
| # Increase timeout for heavy scans | |
| CODACY_CLI_TIMEOUT: 1800 | |
| run: | | |
| # Run the analyzer; try to request SARIF output if supported, otherwise run analyze | |
| mkdir -p /tmp/codacy-sarif | |
| if bash ./.codacy/cli.sh analyze --format sarif --out /tmp/codacy-sarif/codacy.sarif; then | |
| echo "Codacy analyze produced SARIF at /tmp/codacy-sarif" | |
| else | |
| echo "Falling back to generic analyze (SARIF may be produced in /tmp)" | |
| bash ./.codacy/cli.sh analyze || true | |
| fi | |
| # Capture the CLI help output to help diagnose available flags on the runner | |
| mkdir -p test_logs/codacy | |
| if bash ./.codacy/cli.sh analyze --help > test_logs/codacy/codacy-analyze-help.txt 2>&1; then | |
| echo "Wrote codacy analyze help to test_logs/codacy/codacy-analyze-help.txt" | |
| else | |
| echo "Failed to capture analyze --help to test_logs/codacy/codacy-analyze-help.txt" | |
| fi | |
| mkdir -p test_logs/codacy | |
| # Copy any SARIF files produced into the workspace for artifact upload | |
| cp /tmp/codacy-sarif/*.sarif test_logs/codacy/ 2>/dev/null || true | |
| cp /tmp/*.sarif test_logs/codacy/ 2>/dev/null || true | |
| ls -la test_logs/codacy || echo "No SARIF files found" | |
| - name: Upload SARIF artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: codacy-sarif | |
| path: | | |
| test_logs/codacy/*.sarif | |
| test_logs/codacy/codacy-analyze-help.txt |