From 2ddcfae010d2efb8192955b184f9f0e53446b780 Mon Sep 17 00:00:00 2001 From: zyd Date: Tue, 24 May 2022 21:01:04 +0900 Subject: [PATCH 1/2] Add new coverage workflow --- .github/workflows/code-coverage.yml | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/code-coverage.yml diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml new file mode 100644 index 0000000..249d7f5 --- /dev/null +++ b/.github/workflows/code-coverage.yml @@ -0,0 +1,45 @@ +name: Report code coverage + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Sets up python3 + - uses: actions/setup-python@v2 + with: + python-version: 3.x + + # Install dependencies + - name: "Installs dependencies" + run: | + python3 -m pip install --upgrade pip + python3 -m pip install pylint --upgrade + python3 -m pip install pytest --upgrade + + - uses: pre-commit/action@v2.0.3 + + - name: Generate coverage report + run: | + pip install pytest + pip install pytest-cov + pytest --cov=ramda --cov-report=xml + + - name: "Upload coverage to Codecov" + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true From 070a2ebc34262f0f0df8d45cb88bad18981d089a Mon Sep 17 00:00:00 2001 From: zyd Date: Tue, 24 May 2022 21:12:37 +0900 Subject: [PATCH 2/2] modify name --- .github/workflows/code-coverage.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 249d7f5..61606bf 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -1,4 +1,4 @@ -name: Report code coverage +name: Code coverage # Controls when the workflow will run on: @@ -31,8 +31,6 @@ jobs: python3 -m pip install pylint --upgrade python3 -m pip install pytest --upgrade - - uses: pre-commit/action@v2.0.3 - - name: Generate coverage report run: | pip install pytest