-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/github_actions/hmarr/auto-appro…
…ve-action-4.0.0
- Loading branch information
Showing
295 changed files
with
8,119 additions
and
9,296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: lint | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'gh-pages' | ||
pull_request: | ||
branches: [ master, pydantic_v2 ] | ||
|
||
jobs: | ||
lint: | ||
name: "Python ${{ matrix.python-version }}" | ||
runs-on: ubuntu-latest | ||
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 Poetry | ||
uses: snok/[email protected] | ||
with: | ||
version: 1.4.2 | ||
virtualenvs-create: false | ||
|
||
- name: Poetry details | ||
run: | | ||
poetry --version | ||
poetry config --list | ||
- name: Install dependencies | ||
run: poetry install --extras "all" --no-root | ||
|
||
- name: Format | ||
run: make fmt | ||
|
||
- name: Lint | ||
run: make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: build | ||
name: test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'gh-pages' | ||
pull_request: | ||
branches: [ master ] | ||
branches: [ master, pydantic_v2 ] | ||
|
||
jobs: | ||
tests: | ||
|
@@ -17,7 +17,7 @@ jobs: | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar' | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, "3.10", 3.11] | ||
python-version: [3.8, 3.9, "3.10", 3.11] | ||
fail-fast: false | ||
services: | ||
mysql: | ||
|
@@ -39,35 +39,75 @@ jobs: | |
POSTGRES_DB: testsuite | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 --name postgres | ||
|
||
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" | ||
|
||
- name: Run mysql | ||
env: | ||
DATABASE_URL: "mysql://username:[email protected]:3306/testsuite" | ||
run: bash scripts/test.sh | ||
|
||
- name: Install postgresql-client | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --yes postgresql-client | ||
- name: Connect to PostgreSQL with CLI | ||
run: env PGPASSWORD=password psql -h localhost -U username -c 'SELECT VERSION();' testsuite | ||
|
||
- name: Show max connections | ||
run: env PGPASSWORD=password psql -h localhost -U username -c 'SHOW max_connections;' testsuite | ||
|
||
- name: Alter max connections | ||
run: | | ||
docker exec -i postgres bash << EOF | ||
sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf | ||
sed -i -e 's/shared_buffers = 128MB/shared_buffers = 512MB/' /var/lib/postgresql/data/postgresql.conf | ||
EOF | ||
docker restart --time 0 postgres | ||
sleep 5 | ||
- name: Show max connections | ||
run: env PGPASSWORD=password psql -h localhost -U username -c 'SHOW max_connections;' testsuite | ||
|
||
- 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 | ||
- run: mypy ormar tests benchmarks | ||
|
||
- 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' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: test_docs | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'gh-pages' | ||
pull_request: | ||
branches: [ master, pydantic_v2 ] | ||
|
||
jobs: | ||
tests_docs: | ||
name: "Python ${{ matrix.python-version }}" | ||
runs-on: ubuntu-latest | ||
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 | ||
run: | | ||
python -m pip install poetry==1.4.2 | ||
poetry install --extras "all" | ||
env: | ||
POETRY_VIRTUALENVS_CREATE: false | ||
- name: Test docs | ||
run: bash scripts/test_docs.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: type_check | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'gh-pages' | ||
pull_request: | ||
branches: [ master, pydantic_v2 ] | ||
|
||
jobs: | ||
lint: | ||
name: "Python ${{ matrix.python-version }}" | ||
runs-on: ubuntu-latest | ||
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 Poetry | ||
uses: snok/[email protected] | ||
with: | ||
version: 1.4.2 | ||
virtualenvs-create: false | ||
|
||
- name: Poetry details | ||
run: | | ||
poetry --version | ||
poetry config --list | ||
- name: Install dependencies | ||
run: poetry install --extras "all" --no-root | ||
|
||
- name: Type check | ||
run: make type_check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,9 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
- repo: local | ||
hooks: | ||
- id: black | ||
exclude: ^(docs_src/|examples/) | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
exclude: ^(docs_src/|examples/|tests/) | ||
args: [ '--max-line-length=88' ] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.982 | ||
hooks: | ||
- id: mypy | ||
exclude: ^(docs_src/|examples/) | ||
args: [--no-strict-optional, --ignore-missing-imports] | ||
additional_dependencies: [ | ||
types-ujson>=0.1.1, | ||
types-PyMySQL>=1.0.2, | ||
types-ipaddress>=1.0.0, | ||
types-enum34>=1.1.0, | ||
types-cryptography>=3.3.5, | ||
types-orjson>=3.6.0, | ||
types-aiofiles>=0.1.9, | ||
types-pkg-resources>=0.1.3, | ||
types-requests>=2.25.9, | ||
types-toml>=0.10.0, | ||
pydantic>=1.8.2 | ||
] | ||
- id: pre-commit-local | ||
name: format | ||
entry: make pre-commit | ||
language: python | ||
pass_filenames: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.