Skip to content

Gotemir check

Gotemir check #1858

Workflow file for this run

# The MIT License (MIT).
#
# Copyright (c) 2018-2024 Almaz Ilaletdinov <a.ilaletdinov@yandex.ru>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
# OR OTHER DEALINGS IN THE SOFTWARE.
name: Check pull request
on:
pull_request:
branches: [ "master" ]
push:
branches: [ "master" ]
permissions:
contents: read
jobs:
setup:
uses: blablatdinov/tg-quranbot/.github/workflows/installing-dependencies.yml@master
tests:
needs: setup
runs-on: ubuntu-24.04
env:
TZ: "Europe/Moscow"
services:
postgres:
image: postgres:13.3
env:
POSTGRES_USER: almazilaletdinov
POSTGRES_DB: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:6
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
rabbitmq:
image: rabbitmq:3.13.7
ports:
- 5672:5672
- 15672:15672
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
options: --health-cmd "rabbitmqctl status" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12.5"
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: create .env file
run: echo '${{ secrets.E2E_ENV_SETUP }}' > .env
- name: Run tests with pytest
run: .venv/bin/pytest src --ignore=src/tests/e2e --doctest-modules --cov --cov-report xml --cov-fail-under=95
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
# fail_ci_if_error: true
- name: Check dependencies relevance
run: .venv/bin/deltaver poetry.lock --format lock
gotemir:
runs-on: ubuntu-24.04
name: Src and tests structure check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run gotemir
run: |
VERSION="0.0.1-a6"
curl -O -L -C - https://github.com/blablatdinov/gotemir/download/$VERSION/gotemir-linux-amd64.tar
tar -xvf gotemir-linux-amd64.tar
ls -la
./gotemir-linux-amd64
shell: bash
lint:
needs: setup
uses: blablatdinov/tg-quranbot/.github/workflows/lint.yml@master
check-duplicates:
runs-on: ubuntu-24.04
name: Check duplicated code
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install jscpd
run: npm i jscpd -g
- name: Run jscpd
run: jscpd -p '**/*.py' -t 33 --ignore-pattern "from.*import\s"
check-spelling:
runs-on: ubuntu-24.04
name: Check spelling
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install cspell
run: npm i cspell@8.15.4 @cspell/dict-ru_ru@2.2.4 -g
- name: Run cspell
run: find . -type f \( -iname \*.py -o -iname \*.md \) | xargs cspell --no-progress --show-suggestions --show-context