|
| 1 | +name: CI |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + lint: |
| 5 | + runs-on: ubuntu-latest |
| 6 | + strategy: |
| 7 | + max-parallel: 4 |
| 8 | + matrix: |
| 9 | + python-version: ['3.8'] |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v2 |
| 12 | + - name: Set up Python ${{ matrix.python-version }} |
| 13 | + uses: actions/setup-python@v1 |
| 14 | + with: |
| 15 | + python-version: ${{ matrix.python-version }} |
| 16 | + architecture: x64 |
| 17 | + - name: Install CI dependencies |
| 18 | + run: | |
| 19 | + python -m pip install --upgrade pip |
| 20 | + pip install tox~=3.14.3 tox-venv~=0.4.0 |
| 21 | + - name: Run lint |
| 22 | + run: tox -e pylint |
| 23 | + test: |
| 24 | + needs: lint |
| 25 | + runs-on: ubuntu-latest |
| 26 | + strategy: |
| 27 | + max-parallel: 4 |
| 28 | + matrix: |
| 29 | + python-version: ['3.6', '3.7', '3.8'] |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v2 |
| 32 | + - name: Set up Python ${{ matrix.python-version }} |
| 33 | + uses: actions/setup-python@v1 |
| 34 | + with: |
| 35 | + python-version: ${{ matrix.python-version }} |
| 36 | + architecture: x64 |
| 37 | + - name: Install CI dependencies |
| 38 | + run: | |
| 39 | + python -m pip install --upgrade pip |
| 40 | + pip install tox~=3.14.3 tox-venv~=0.4.0 |
| 41 | + - name: Run tests |
| 42 | + run: tox -e coverage-xml -- --junitxml="test-reports/junit-${{ matrix.python-version }}.xml" |
| 43 | + - name: Upload test results artifact |
| 44 | + uses: actions/upload-artifact@master |
| 45 | + with: |
| 46 | + name: test-results-${{ matrix.python-version }} |
| 47 | + path: test-reports/junit-${{ matrix.python-version }}.xml |
| 48 | + if: always() |
| 49 | + - name: Upload coverage results artifact |
| 50 | + uses: actions/upload-artifact@master |
| 51 | + with: |
| 52 | + name: coverage-${{ matrix.python-version }} |
| 53 | + path: coverage.xml |
| 54 | + if: always() |
| 55 | + coverage: |
| 56 | + needs: test |
| 57 | + runs-on: ubuntu-latest |
| 58 | + strategy: |
| 59 | + max-parallel: 4 |
| 60 | + matrix: |
| 61 | + python-version: ['3.8'] |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v2 |
| 64 | + - name: Set up Python ${{ matrix.python-version }} |
| 65 | + uses: actions/setup-python@v1 |
| 66 | + with: |
| 67 | + python-version: ${{ matrix.python-version }} |
| 68 | + architecture: x64 |
| 69 | + - name: Install CI dependencies |
| 70 | + run: | |
| 71 | + python -m pip install --upgrade pip |
| 72 | + pip install codecov~=2.0.15 |
| 73 | + - uses: actions/download-artifact@v1 |
| 74 | + with: |
| 75 | + name: coverage-${{ matrix.python-version }} |
| 76 | + path: coverage.xml |
| 77 | + - name: Upload coverage results to CodeCov |
| 78 | + run: codecov -t ${{ secrets.CODECOV_TOKEN }} |
0 commit comments