|
|
- name: Django CI
-
- on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
- jobs:
- build:
-
- runs-on: ubuntu-20.04
- strategy:
- matrix:
- db: [sqlite, postgres, mysql]
- python-version: [3.6, 3.7, 3.8]
- include:
- - db: postgres
- db_port: 5432
- - db: mysql
- db_port: 3306
-
- services:
- postgres:
- image: postgres:10
- env:
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: hunter2
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- ports:
- - 5432:5432
- mysql:
- image: mysql:5.7
- env:
- MYSQL_ROOT_PASSWORD: hunter2
- ports:
- - 3306:3306
- options: >-
- --health-cmd="mysqladmin ping"
- --health-interval=10s
- --health-timeout=5s
- --health-retries=3
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
- with:
- python-version: ${{ matrix.python-version }}
- - name: Install Dependencies
- run: |
- python -m pip install --upgrade pip
- pip install -r requirements.txt
- pip install apprise braintree coverage mysqlclient
- - name: Run Tests
- env:
- DB: ${{ matrix.db }}
- DB_HOST: 127.0.0.1
- DB_PORT: ${{ matrix.db_port }}
- DB_PASSWORD: hunter2
- run: |
- coverage run --omit=*/tests/* --source=hc manage.py test
- - name: Coveralls Parallel
- uses: coverallsapp/github-action@master
- with:
- github-token: ${{ secrets.github_token }}
- flag-name: run-${{ matrix.python-version }}-${{ matrix.db }}
- parallel: true
- finish:
- needs: build
- runs-on: ubuntu-20.04
- steps:
- - name: Coveralls Finished
- uses: coverallsapp/github-action@master
- with:
- github-token: ${{ secrets.github_token }}
- parallel-finished: true
|