Skip to content

add check code

add check code #3

Workflow file for this run

name: Code check
on:
pull_request:
branches: [ "develop" ]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run DataBase
run: docker run -d \
--name postgres_container \
-e POSTGRES_DB=rtt_test \
-e POSTGRES_USER=admin_test \
-e POSTGRES_PASSWORD=postgre_admin \
-p 5432:5432 \
postgres:14
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: poetry install
if: steps.cache-poetry.outputs.cache-hit != 'true'
- name: Run pre-commit
run: |
poetry run pre-commit