Skip to content

echi env

echi env #56

Workflow file for this run

name: CI Pipeline
on:
push:
paths-ignore:
- 'ansible/**'
- '**/*.md'
env:
PYTHON_VERSION: 3.11
POETRY_VERSION: 1.7.1
FLAKE_CC_MAX_THRESHOLD: 10
CLIENTEMAIL: ${{ secrets.CLIENTEMAIL }}
CLIENTID: ${{ secrets.CLIENTID }}
PRIVATEKEY: ${{ secrets.PRIVATEKEY }}
PRIVATEKEYID: ${{ secrets.PRIVATEKEYID }}
PROJECTID: ${{ secrets.PROJECTID }}
TOKENURI: ${{ secrets.TOKENURI }}
TYPE: ${{ secrets.TYPE }}
APIKEY: ${{ secrets.APIKEY }}
AUTHDOMAIN: ${{ secrets.AUTHDOMAIN }}
ACCESSKEY: ${{ secrets.ACCESSKEY }}
BUCKET: ${{ secrets.BUCKET }}
ENDPOINT: ${{ secrets.ENDPOINT }}
SECRET: ${{ secrets.SECRET }}
jobs:
show_environment:
name: "Show environment variables"
runs-on: ubuntu-latest
steps:
- name: "Show environmetn variables"
run: |
env
lint-complexity:
name: Lint & Complexity Check
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install Dependencies
run: poetry install
- name: Run flake8 Complexity
run: poetry run flake8 --select=C --max-complexity=${{ env.FLAKE_CC_MAX_THRESHOLD }} bin/ internal/ tests/
- name: Run flake8 Lint
run: poetry run flake8 bin/ internal/ tests/
security:
name: Security Check
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install Dependencies
run: poetry install
- name: Run bandit
run: poetry run bandit -c pyproject.toml -r bin/ internal/
test:
name: Test
runs-on: ubuntu-22.04
timeout-minutes: 10
needs:
- lint-complexity
- security
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install Dependencies
run: poetry install
- name: Run pytest with coverage
run: >
poetry run pytest \
--junitxml=reports/test-report.xml \
--html=reports/report.html \
--cov-report=term-missing \
--cov=internal \
--cov-fail-under=60 tests/
- name: Upload test report
uses: actions/upload-artifact@v3
with:
name: test-report
path: ./reports/