diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..284f5ab --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,36 @@ +name: lint +on: + pull_request: + branches: + - '*' + push: + branches: + - 'main' +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: install python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: set up poetry + uses: abatilo/actions-poetry@v2 + with: + poetry-version: '1.8.2' + - name: set up virtual environment + run: | + poetry config virtualenvs.create true --local + poetry config virtualenvs.in-project true --local + - name: cache virtual environment + uses: actions/cache@v4 + with: + path: ./.venv + key: venv-${{ hashFiles('poetry.lock') }} + - name: install dependencies + run: poetry install --with dev + - name: check linter and formatter + run: | + poetry run ruff check . + poetry run ruff format --check . \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 85e8689..9f3c8a9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -45,11 +45,7 @@ jobs: path: ./.venv key: venv-${{ hashFiles('poetry.lock') }} - name: install dependencies - run: poetry install --with dev,test - - name: check linter and formatter - run: | - poetry run ruff check . - poetry run ruff format --check . + run: poetry install --with test - name: check migrations run: poetry run python manage.py makemigrations --check - name: run tests