feat: update apckage #76
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration on Pull Request | |
on: | |
pull_request: | |
branches: [staging, main] | |
push: | |
branches: [staging, main] | |
env: | |
POETRY_VERSION: 1.4.1 | |
jobs: | |
Audit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.8.3 | |
virtualenvs-create: false | |
installer-parallel: true | |
- name: Installing audit tool | |
run: poetry self add poetry-audit-plugin | |
- name: Executing | |
run: poetry audit | |
Test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:15.1 | |
env: | |
POSTGRES_PASSWORD: db_password | |
POSTGRES_USER: root | |
POSTGRES_DB: monetization | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
env: | |
APP_NAME: auth-plus-monetization | |
PORT: 5005 | |
PYTHON_ENV: test | |
DATABASE_URL: postgresql+psycopg2://root:db_password@localhost:5432/monetization | |
REDIS_URL: redis://localhost:6379 | |
KAFKA_URL: | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Running migrations | |
run: HOST=localhost make migration/up | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.8.3 | |
virtualenvs-create: false | |
installer-parallel: true | |
- name: Install depedencies | |
run: poetry install | |
- name: Generating Coverage | |
run: coverage run -m pytest | |
- name: Exporting lcov and xml | |
run: coverage lcov && coverage xml | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Code Climate Scan | |
uses: paambaati/codeclimate-action@v9.0.0 | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }} | |
with: | |
coverageLocations: ${{github.workspace}}/coverage.lcov:lcov | |
- name: Codacy Scan | |
uses: codacy/codacy-coverage-reporter-action@v1.3.0 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage.xml | |
Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.8.3 | |
virtualenvs-create: false | |
installer-parallel: true | |
- name: Install depedencies | |
run: poetry install | |
- name: Running flake8 | |
run: flake8 src/ -v | |
- name: Running mypy | |
run: mypy src/ -v --check-untyped-defs |