diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index 3699fa9..e8863c5 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -1,101 +1,16 @@ name: Quality gate on: - push: - branches: - - main pull_request: branches: - main types: [ opened, synchronize, reopened ] jobs: - sonar: - name: SonarQube Analysis - runs-on: ubuntu-latest + quality-gate: + uses: Aignosi/github_workflow_templates/.github/workflows/dataops-module-quality-gate.yml@main permissions: write-all - steps: - - name: โฌ‡๏ธ Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Generate App Token - id: generate-app-token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - owner: 'Aignosi' - repositories: 'sientia-dataops-library,sientia-mlops-library' - - - name: Prepare requirements.txt - id: prepare-requirements - run: | - sed -e "s|git+ssh://git@github.com/|git+https://github.com/|g" \ - -e "s|git@github.com:|git+https://github.com/|g" \ - requirements.txt > requirements_prepared.txt - echo "PROCESSED_REQUIREMENTS_FILE=requirements_prepared.txt" >> $GITHUB_OUTPUT - - - name: Configure Git to use App Token - env: - GH_APP_TOKEN: ${{ steps.generate-app-token.outputs.token }} - run: | - git config --global url."https://oauth2:${GH_APP_TOKEN}@github.com/".insteadOf "https://github.com/" - - - name: ๐Ÿ”ง Setup Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: ๐Ÿ—„๏ธ Cache Python dependencies - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles(steps.prepare-requirements.outputs.PROCESSED_REQUIREMENTS_FILE) }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: ๐Ÿ“ฆ Install Development Dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - - - name: ๐Ÿ“ฆ Install Runtime Dependencies - run: | - pip install -r ${{ steps.prepare-requirements.outputs.PROCESSED_REQUIREMENTS_FILE }} - - - name: ๐Ÿ“ Code Formatting Check (Ruff) - run: | - echo "Checking code formatting..." - ruff format --check scouter/ tests/ - continue-on-error: false - - - name: ๐Ÿ”Ž Code Linting (Ruff) - run: | - echo "Running linting checks..." - ruff check scouter/ tests/ - continue-on-error: false - - - name: ๐Ÿท๏ธ Type Checking (mypy) - run: | - echo "Running type checks..." - mypy scouter/ - continue-on-error: true - - - name: ๐Ÿ”’ Security Analysis (Bandit) - run: | - echo "Running security analysis..." - bandit -r scouter/ -ll -q - continue-on-error: true - - - name: ๐Ÿงช Run Tests with Pytest - run: | - pytest tests --junitxml=pytest.xml --cov=scouter --cov-report=xml --cov-report=term - - - name: Run SonarQube Analysis - uses: SonarSource/sonarqube-scan-action@v5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + with: + project_name: 'scouter' + repositories: 'sientia-dataops-library' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cba1cce --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,15 @@ +name: Create Release on Merge to Main + +on: + pull_request: + types: [closed] + branches: + - main + +jobs: + release: + uses: Aignosi/github_workflow_templates/.github/workflows/dataops-module-release.yml@main + permissions: write-all + with: + project_name: 'scouter' + secrets: inherit \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3d75d5e..8589717 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,6 @@ asyncua redis aiokafka pymongo -git+ssh://git@github.com/Aignosi/sientia-dataops-library.git@1.4.6 +git+ssh://git@github.com/Aignosi/sientia-dataops-library.git@1.4.7 pydruid[pandas] prometheus-client \ No newline at end of file