Merge pull request #27 from Aignosi/feature/SIENTIAPDE-1327-controle-de-releases
SIENTIAPDE-1327: Update requirements and simplify CI workflow for quality checks
This commit is contained in:
98
.github/workflows/quality-gate.yml
vendored
98
.github/workflows/quality-gate.yml
vendored
@@ -1,101 +1,17 @@
|
|||||||
name: Quality gate
|
name: Quality gate
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
types: [ opened, synchronize, reopened ]
|
types: [ opened, synchronize, reopened ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sonar:
|
quality-gate:
|
||||||
name: SonarQube Analysis
|
uses: Aignosi/github_workflow_templates/.github/workflows/dataops-module-quality-gate.yml@main
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
steps:
|
with:
|
||||||
- name: ⬇️ Checkout Code
|
project_name: 'laborious'
|
||||||
uses: actions/checkout@v4
|
repositories: 'sientia-dataops-library, sientia-mlops-library'
|
||||||
with:
|
requirements_file: 'requirements-light.txt'
|
||||||
fetch-depth: 0
|
secrets: inherit
|
||||||
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-light.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-light.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 laborious/ tests/
|
|
||||||
continue-on-error: false
|
|
||||||
|
|
||||||
- name: 🔎 Code Linting (Ruff)
|
|
||||||
run: |
|
|
||||||
echo "Running linting checks..."
|
|
||||||
ruff check laborious/ tests/
|
|
||||||
continue-on-error: false
|
|
||||||
|
|
||||||
- name: 🏷️ Type Checking (mypy)
|
|
||||||
run: |
|
|
||||||
echo "Running type checks..."
|
|
||||||
mypy laborious/
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: 🔒 Security Analysis (Bandit)
|
|
||||||
run: |
|
|
||||||
echo "Running security analysis..."
|
|
||||||
bandit -r laborious/ -ll -q
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: 🧪 Run Tests with Pytest
|
|
||||||
run: |
|
|
||||||
pytest tests --junitxml=pytest.xml --cov=laborious --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 }}
|
|
||||||
15
.github/workflows/release.yml
vendored
Normal file
15
.github/workflows/release.yml
vendored
Normal file
@@ -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: 'laborious'
|
||||||
|
secrets: inherit
|
||||||
@@ -10,3 +10,6 @@ botocore
|
|||||||
boto3
|
boto3
|
||||||
s3fs
|
s3fs
|
||||||
pyarrow
|
pyarrow
|
||||||
|
kaleido
|
||||||
|
hyperopt
|
||||||
|
shap
|
||||||
Reference in New Issue
Block a user