feat: initial version #3
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: Test Twyn Action | |
| on: | |
| push: | |
| branches: [main, init] | |
| pull_request: | |
| branches: [main, init] | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| test-basic: | |
| name: Basic Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Test Basic Action (JSON output) | |
| uses: ./ | |
| with: | |
| json: true | |
| dependency-file: "requirements.txt" | |
| test-table-format: | |
| name: Test Table Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Test Table Format (v6) | |
| uses: ./ | |
| with: | |
| table: true | |
| version: "v6" | |
| dependency-file: "requirements.txt" | |
| test-version-validation: | |
| name: Test Version Validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Test Invalid Version (should fail) | |
| id: invalid-version | |
| continue-on-error: true | |
| uses: ./ | |
| with: | |
| table: true | |
| version: "v5.0.0" | |
| dependency-file: "requirements.txt" | |
| - name: Check that invalid version failed | |
| run: | | |
| if [ "${{ steps.invalid-version.outcome }}" != "failure" ]; then | |
| echo "❌ Test failed: Invalid version should have caused failure" | |
| exit 1 | |
| else | |
| echo "✅ Test passed: Invalid version correctly rejected" | |
| fi | |
| test-with-outputs: | |
| name: Test Action Outputs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Run Twyn with outputs | |
| id: twyn-test | |
| uses: ./ | |
| with: | |
| json: true | |
| dependency-file: "requirements.txt" | |
| - name: Check outputs | |
| run: | | |
| echo "Exit Code: ${{ steps.twyn-test.outputs.exit-code }}" | |
| echo "Has Findings: ${{ steps.twyn-test.outputs.has-findings }}" | |
| echo "Results (truncated): ${{ steps.twyn-test.outputs.results }}" | |
| # Validate output format | |
| if [ -z "${{ steps.twyn-test.outputs.exit-code }}" ]; then | |
| echo "❌ exit-code output is missing" | |
| exit 1 | |
| fi | |
| if [ -z "${{ steps.twyn-test.outputs.has-findings }}" ]; then | |
| echo "❌ has-findings output is missing" | |
| exit 1 | |
| fi | |
| echo "✅ All outputs are present" | |
| test-pr-comment: | |
| name: Test PR Comment (simulation) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Test PR Comment Publishing | |
| uses: ./ | |
| with: | |
| table: true | |
| version: "v6" | |
| publish: true | |
| dependency-file: "requirements.txt" | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| test-verbose-mode: | |
| name: Test Verbose Mode | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Test Verbose Output | |
| uses: ./ | |
| with: | |
| vv: true | |
| table: true | |
| version: "v5.0.0" | |
| dependency-file: "requirements.txt" |