11# This workflow will install Python dependencies, run tests and lint with a single version of Python
22# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33
4- name : build
4+ name : test
55
66on :
77 push :
88 branches-ignore :
99 - ' gh-pages'
1010 pull_request :
11- branches : [ master ]
11+ branches : [ master, pydantic_v2 ]
1212
1313jobs :
1414 tests :
1717 if : github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar'
1818 strategy :
1919 matrix :
20- python-version : [3.7, 3. 8, 3.9, "3.10"]
20+ python-version : [3.8, 3.9, "3.10", 3.11 ]
2121 fail-fast : false
2222 services :
2323 mysql :
@@ -39,37 +39,80 @@ jobs:
3939 POSTGRES_DB : testsuite
4040 ports :
4141 - 5432:5432
42- options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
42+ options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 --name postgres
4343
4444 steps :
45- - uses : actions/checkout@v3
45+ - name : Checkout
46+ uses : actions/checkout@v4
47+ with :
48+ submodules : false
4649 - name : Set up Python
47- uses : actions/setup-python@v4
50+ uses : actions/setup-python@v5
4851 with :
4952 python-version : ${{ matrix.python-version }}
50- - name : Install dependencies
53+
54+ - name : Install Poetry
55+ uses : snok/install-poetry@v1.3.3
56+ with :
57+ version : 1.4.2
58+ virtualenvs-create : false
59+
60+ - name : Poetry details
5161 run : |
52- python -m pip install poetry==1.1.11
53- poetry install --extras "all"
54- env :
55- POETRY_VIRTUALENVS_CREATE : false
62+ poetry --version
63+ poetry config --list
64+
65+ - name : Install dependencies
66+ run : poetry install --extras "all"
67+
5668 - name : Run mysql
5769 env :
5870 DATABASE_URL : " mysql://username:password@127.0.0.1:3306/testsuite"
5971 run : bash scripts/test.sh
72+
73+ - name : Install postgresql-client
74+ run : |
75+ sudo apt-get update
76+ sudo apt-get install --yes postgresql-client
77+
78+ - name : Connect to PostgreSQL with CLI
79+ run : env PGPASSWORD=password psql -h localhost -U username -c 'SELECT VERSION();' testsuite
80+
81+ - name : Show max connections
82+ run : env PGPASSWORD=password psql -h localhost -U username -c 'SHOW max_connections;' testsuite
83+
84+ - name : Alter max connections
85+ run : |
86+
87+ docker exec -i postgres bash << EOF
88+ sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf
89+ sed -i -e 's/shared_buffers = 128MB/shared_buffers = 512MB/' /var/lib/postgresql/data/postgresql.conf
90+ EOF
91+ docker restart --time 0 postgres
92+ sleep 5
93+
94+ - name : Show max connections
95+ run : env PGPASSWORD=password psql -h localhost -U username -c 'SHOW max_connections;' testsuite
96+
6097 - name : Run postgres
6198 env :
6299 DATABASE_URL : " postgresql://username:password@localhost:5432/testsuite"
63100 run : bash scripts/test.sh
101+
64102 - name : Run sqlite
65103 env :
66104 DATABASE_URL : " sqlite:///testsuite"
67105 run : bash scripts/test.sh
68- - run : mypy ormar tests
106+
69107 - name : Upload coverage
70- uses : codecov/codecov-action@v3.1.1
108+ uses : codecov/codecov-action@v4.1.0
109+ with :
110+ name : codecov-umbrella
111+ token : ${{ secrets.CODCOV_TOKEN }}
112+ verbose : true
113+
71114 - name : Test & publish code coverage
72- uses : paambaati/codeclimate-action@v3.2 .0
115+ uses : paambaati/codeclimate-action@v5.0 .0
73116 if : github.event.pull_request.head.repo.full_name == 'collerek/ormar'
74117 env :
75118 CC_TEST_REPORTER_ID : ${{ secrets.CC_COVERAGE_TOKEN }}
0 commit comments