Skip to content

Cross-language parity: unified case-insensitive pattern superset, TS harmful-content check, strict parse (#30) #127

Cross-language parity: unified case-insensitive pattern superset, TS harmful-content check, strict parse (#30)

Cross-language parity: unified case-insensitive pattern superset, TS harmful-content check, strict parse (#30) #127

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
if: >
github.actor != 'dependabot[bot]' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.fork == false)
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pytest-asyncio
pip install -e ".[langchain,openai]"
- name: Run Tests and Generate Coverage
run: |
pytest --cov=src/qwed_open_responses --cov-report=xml tests/
- name: Set up Java 21
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: '21'
- name: Configure SonarScanner to use Java 21
run: |
echo "SONAR_SCANNER_JAVA_EXE_PATH=$JAVA_HOME/bin/java" >> "$GITHUB_ENV"
echo "SONAR_SCANNER_OPTS=-Dsonar.scanner.skipJreProvisioning=true" >> "$GITHUB_ENV"
- name: Verify Java version
run: |
version="$("$SONAR_SCANNER_JAVA_EXE_PATH" -version 2>&1)"
echo "$version"
grep -Eq 'version "21([."]|$)' <<< "$version"
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io
- name: SonarCloud Quality Gate
uses: SonarSource/sonarqube-quality-gate-action@cf038b0e0cdecfa9e56c198bbb7d21d751d62c3b # v1.2.0
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}