From a648872c0f4d502371fc6ff91d37e9779f6363e2 Mon Sep 17 00:00:00 2001 From: m5ka Date: Wed, 27 Mar 2024 09:55:30 +0000 Subject: [PATCH] =?UTF-8?q?ci:=20=F0=9F=A7=BC=20separate=20testing=20and?= =?UTF-8?q?=20linting=20into=20two=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yaml | 36 ++++++++++++++++++++++++++++++++++++ .github/workflows/test.yaml | 6 +----- 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/lint.yaml 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