Skip to content

Commit

Permalink
tweak workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
collerek committed Feb 2, 2024
1 parent bbe1cde commit d0b8154
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 19 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,28 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar'
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies

- name: Install Poetry
uses: snok/[email protected]
with:
version: 1.4.2
virtualenvs-create: false

- name: Poetry details
run: |
python -m pip install poetry==1.4.2
poetry install --extras "all"
env:
POETRY_VIRTUALENVS_CREATE: false
poetry --version
poetry config --list
- name: Install dependencies
run: poetry install --extras "all" --no-root

- name: Format
run: python -m black .
run: make fmt

- name: Lint
run: python -m ruff . --fix
run: make lint
29 changes: 23 additions & 6 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,48 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
submodules: false

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies

- name: Install Poetry
uses: snok/[email protected]
with:
version: 1.4.2
virtualenvs-create: false

- name: Poetry details
run: |
python -m pip install poetry==1.4.2
poetry install --extras "all"
env:
POETRY_VIRTUALENVS_CREATE: false
poetry --version
poetry config --list
- name: Install dependencies
run: poetry install --extras "all" --no-root

- name: Run mysql
env:
DATABASE_URL: "mysql://username:[email protected]:3306/testsuite"
run: bash scripts/test.sh

- name: Run postgres
env:
DATABASE_URL: "postgresql://username:password@localhost:5432/testsuite"
run: bash scripts/test.sh

- name: Run sqlite
env:
DATABASE_URL: "sqlite:///testsuite"
run: bash scripts/test.sh

- name: Upload coverage
uses: codecov/[email protected]

- name: Test & publish code coverage
uses: paambaati/[email protected]
if: github.event.pull_request.head.repo.full_name == 'collerek/ormar'
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar'
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies

- name: Install Poetry
uses: snok/[email protected]
with:
version: 1.4.2
virtualenvs-create: false

- name: Poetry details
run: |
python -m pip install poetry==1.4.2
poetry install --extras "all"
env:
POETRY_VIRTUALENVS_CREATE: false
poetry --version
poetry config --list
- name: Install dependencies
run: poetry install --extras "all" --no-root

- name: Type check
run: python -m mypy ormar tests --ignore-missing-imports --install-types --non-interactive
run: make type_check

0 comments on commit d0b8154

Please sign in to comment.