|
| 1 | + |
| 2 | +name: release |
| 3 | + |
| 4 | +on: |
| 5 | + release: |
| 6 | + types: [released] |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + python-version: [2.7] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v2 |
| 19 | + |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v2 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + python -m pip install --upgrade pip |
| 28 | + # It seems that coverage6.0 has been released, and it resolves to 6.0, which causes an error in coverage-badge, so tentatively specifying the coverage version. |
| 29 | + # pip install flake8 pytest pytest-cov coverage-badge |
| 30 | + pip install flake8 pytest 'coverage>=5.5,<6' pytest-cov coverage-badge |
| 31 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 32 | +
|
| 33 | + - name: Lint with flake8 |
| 34 | + run: | |
| 35 | + # stop the build if there are Python syntax errors or undefined names |
| 36 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 37 | + # exit-zero treats all errors as warnings. |
| 38 | + flake8 . --exclude tests --ignore E301,E302,E303,E305,W391 --count --exit-zero --max-complexity=10 --max-line-length=300 --statistics |
| 39 | +
|
| 40 | + - name: Test with pytest & Collect coverage |
| 41 | + run: | |
| 42 | + pytest -v tests --cov=src.csvdiff2 --cov-report=term-missing --cov-report=html |
| 43 | +
|
| 44 | + - name: Make coverage badge |
| 45 | + run: | |
| 46 | + coverage-badge -o ./htmlcov/coverage.svg |
| 47 | +
|
| 48 | + - name: Upload coverage-report to GitHub Pages |
| 49 | + uses: peaceiris/actions-gh-pages@v3 |
| 50 | + with: |
| 51 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + publish_dir: ./htmlcov |
0 commit comments