Skip to content

JetBrains Plugin | Implement ASCA Engine (AST-69534) #854

JetBrains Plugin | Implement ASCA Engine (AST-69534)

JetBrains Plugin | Implement ASCA Engine (AST-69534) #854

Workflow file for this run

name: Checkmarx One Jetbrains Plugin CI
on: [ pull_request, workflow_dispatch ]
env:
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
CX_APIKEY: ${{ secrets.CX_APIKEY }}
CX_TENANT: ${{ secrets.CX_TENANT }}
CX_TEST_REPO: ${{ secrets.CX_TEST_REPO }}
CX_TEST_SCAN: ${{ secrets.CX_TEST_SCAN }}
CX_TEST_BRANCH: ${{ secrets.CX_TEST_BRANCH }}
CX_TEST_PROJECT: ${{ secrets.CX_TEST_PROJECT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CX_NOT_MATCH_TEST_PROJECT: ${{ secrets.CX_NOT_MATCH_TEST_PROJECT }}
CX_NOT_MATCH_TEST_BRANCH: ${{ secrets.CX_NOT_MATCH_TEST_BRANCH }}
CX_NOT_MATCH_TEST_SCAN_ID: ${{ secrets.CX_NOT_MATCH_TEST_SCAN_ID }}
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
testUI:
needs: [ testIntegration ]
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3.13.0
with:
distribution: zulu
java-version: 11
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
token: ${{ secrets.GITHUB_TOKEN }}
# Perform clean before testing
- name: Clean
run: ./gradlew clean
# Run IDEA prepared for UI testing
- name: Run IDE
run: |
mkdir -p build/reports
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x24 &
sleep 10
./gradlew -i runIdeForUiTests > idea.log 2>&1 &
# Wait for IDEA to be started
- name: Health Check
run: curl --fail -sv --retry "15" --retry-delay "10" --retry-connrefused "http://127.0.0.1:8580"
# Run tests
- name: Tests
run: |
export DISPLAY=:99.0
./gradlew test --info --tests com.checkmarx.intellij.ui*
- name: Move video
if: ${{ failure() }}
run: mv video build/reports
# Save report if tests fail
- name: Save fails report
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: test-fails-report
path: |
build/reports
# Save idea log if tests fail
- name: Save idea log
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: idea.log
path: |
idea.log
testIntegration:
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3.13.0
with:
distribution: zulu
java-version: 11
# Perform clean before testing
- name: Clean
run: ./gradlew clean
# Run tests
- name: Tests
run: ./gradlew test -i --tests com.checkmarx.intellij.standard*
# Save report if tests fail
- name: Save fails report
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: test-fails-report-integration
path: |
build/reports