diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9d2d8880f..c0b24d9c5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,93 +1,78 @@ name: ci on: [push, pull_request] jobs: - test-27: + test: runs-on: ${{ matrix.platform }} strategy: matrix: - platform: [ ubuntu-latest ] + platform: [ubuntu-latest] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] env: - PY_COLOR: 1 + PY_COLORS: 1 + steps: - uses: actions/checkout@v2 - - name: Set up Python 2.7 + + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 2.7 - - uses: actions/cache@v1 - if: startsWith(runner.os, 'Linux') - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - uses: actions/cache@v1 - if: startsWith(runner.os, 'Windows') - with: - path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install base dependencies - run: | - python -m pip install --upgrade pip - pip install tox sphinx - - name: Test with tox - run: tox -e py27-test - test-3x: - runs-on: ${{ matrix.platform }} - strategy: - matrix: - platform: [ ubuntu-latest ] - python-version: [ 5, 6, 7, 8 ] - env: - PY_COLOR: 1 - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: 3.${{ matrix.python-version }} - - uses: actions/cache@v1 - if: startsWith(runner.os, 'Linux') - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - uses: actions/cache@v1 - if: startsWith(runner.os, 'Windows') - with: - path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install base dependencies - run: | - python -m pip install --upgrade pip - pip install tox sphinx - - name: Test, coverage, and flake8 with tox - if: matrix.python-version == '8' - run: | - tox -e py3${{ matrix.python-version }}-test - tox -e py3${{ matrix.python-version }}-cov - tox -e py3${{ matrix.python-version }}-lint - pip install codecov || true - codecov || true - - name: Test with tox - if: matrix.python-version != '8' - run: tox -e py3${{ matrix.python-version }}-test - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python to build docs with Sphinx - uses: actions/setup-python@v2 - with: - python-version: 2.7 + python-version: ${{ matrix.python-version }} + - name: Install base dependencies run: | python -m pip install --upgrade pip python -m pip install tox sphinx + + - name: Test with tox + if: matrix.python-version != '3.8' + run: | + tox -e py-test + + - name: Test with tox and get coverage + if: matrix.python-version == '3.8' + run: | + tox -vv -e py-cov + + - name: Upload code coverage + if: matrix.python-version == '3.8' + run: | + pip install codecov || true + codecov || true + + test-docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 2.7 + uses: actions/setup-python@v2 + with: + python-version: 2.7 + + - name: Install base dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox sphinx + - name: Build and check docs using tox run: tox -e docs + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install base dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox sphinx + + - name: Lint with flake8 + run: tox -e py-lint \ No newline at end of file diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index 7d930bb72..6afda7e23 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -5,26 +5,20 @@ on: jobs: test integration: runs-on: ubuntu-latest - strategy: - python-version: 3.8 - env: - PY_COLOR: 1 + steps: - uses: actions/checkout@v2 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: python-version: 3.8 - - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + - name: Install base dependencies run: | python -m pip install --upgrade pip - pip install tox + python -m pip install tox sphinx + - name: Test with tox run: | tox -e int \ No newline at end of file