Skip to content

Commit

Permalink
Merge pull request #10 from amateja/ci_migration
Browse files Browse the repository at this point in the history
Ci migration
  • Loading branch information
amateja committed Nov 29, 2023
2 parents 2b24cc8 + 825d307 commit 79e23b9
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 205 deletions.
201 changes: 201 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: Python test

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install flake8 flake8-comprehensions flake8-eradicate flake8-pep3101 flake8-print flake8-quotes flake8-string-format
- name: Lint with flake8
run: flake8

test_postgres_4x:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
django: ['>=4.1,<4.2', '>=4.2,<5.0']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install coveralls 'django${{ matrix.django }}' psycopg2cffi psycopg[binary]
- name: Execute tests with coverage
env:
DB: postgres
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
coverage run --source=bitoptions testproject/manage.py test testapp
coveralls --service=github
test_mysql_4x:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.35
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
django: ['>=4.1,<4.2', '>=4.2,<5.0']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install coveralls 'django${{ matrix.django }}' mysqlclient
- name: Execute tests with coverage
env:
DB: mysql
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
coverage run --source=bitoptions testproject/manage.py test testapp
coveralls --service=github
test_sqlite_4x:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
django: ['>=4.0,<4.1', '>=4.1,<4.2', '>=4.2,<5.0']
include:
- python-version: '3.12'
django: '>=4.2,<4.3'
- python-version: '3.11'
django: '>=4.2,<4.3'
- python-version: '3.11'
django: '>=4.1,<4.2'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install coveralls 'django${{ matrix.django }}'
- name: Execute tests with coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
coverage run --source=bitoptions testproject/manage.py test testapp
coveralls --service=github
test_sqlite_3x:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
django: ['>=3.0,<3.1', '>=3.1,<3.2', '>=3.2,<4.0']
include:
- python-version: '3.10'
django: '>=3.2,<4.0'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install coveralls 'django${{ matrix.django }}'
- name: Execute tests with coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
coverage run --source=bitoptions testproject/manage.py test testapp
coveralls --service=github
test_legacy:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ['3.5']
django: ['>=1.8,<1.9', '>=1.9,<1.10', '>=1.10,<1.11', '>=1.11,<2.0',
'>=2.0,<2.1', '>=2.1,<2.2', '>=2.2,<3.0']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install coveralls 'django${{ matrix.django }}'
- name: Execute tests with coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
coverage run --source=bitoptions testproject/manage.py test testapp
coveralls --service=github
generate-coverage-report:
runs-on: ubuntu-latest
needs: [test_postgres_4x, test_mysql_4x, test_sqlite_4x, test_sqlite_3x, test_legacy]
steps:
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
python -m pip install coveralls
coveralls --service=github --finish
196 changes: 0 additions & 196 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 79e23b9

Please sign in to comment.