Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #10

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #10

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on: [push]
env:
MENGXIAO_STUDENT_ID: ${{ secrets.MENGXIAO_USERNAME }}
MENGXIAO_PASSWORD: ${{ secrets.MENGXIAO_PASSWORD }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [
"3.6",
"3.7",
"3.8",
"3.9",
"3.10"
]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install --upgrade pytest
python -m pip install --upgrade setuptools
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Sleep for a while
run: |
sleep $((10 + $RANDOM % 50))
- name: Test with pytest
run: |
python -m py.test -s --cov-report=xml --cov --log-level=INFO
- name: Save coverage report
uses: actions/upload-artifact@v2
with:
name: coverage.xml
path: coverage.xml
- name: Test Installation
run: |
python setup.py install
codacy-coverage-reporter:
runs-on: ubuntu-latest
name: codacy-coverage-reporter
needs: build
steps:
- uses: actions/checkout@v2
- name: Load coverage report
uses: actions/[email protected]
with:
name: coverage.xml
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# or
# api-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml