Skip to content

Commit

Permalink
feat: add coverage and setup script steps
Browse files Browse the repository at this point in the history
  • Loading branch information
armand-sauzay committed Mar 1, 2024
1 parent 5709854 commit 6d966e5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ inputs:
required: false
description: Flags and args for test command
default: ""
setup-script:
required: false
description: Script to run before tests
default: ""
upload-coverage:
required: false
description: Upload coverage report to codecov
default: "false"
coveralls-repo-token:
required: false
description: Coveralls repo token
default: ""

runs:
using: composite
Expand All @@ -36,6 +48,11 @@ runs:
shell: bash
run: |
pip install -r requirements.txt
- name: Run setup script
if: hashFiles('poetry.lock') == '' && inputs.setup-script != ''
shell: bash
run: |
${{ inputs.setup-script }}
- name: Run tests
if: hashFiles('poetry.lock') == ''
shell: bash
Expand All @@ -56,6 +73,11 @@ runs:
if: hashFiles('poetry.lock') != ''
shell: bash
run: poetry install
- name: Run setup script
if: hashFiles('poetry.lock') != '' && inputs.setup-script != ''
shell: bash
run: |
${{ inputs.setup-script }}
- name: Run poetry tests
if: hashFiles('poetry.lock') != ''
shell: bash
Expand All @@ -65,3 +87,8 @@ runs:
else
echo "::warning::pytest not found in poetry.lock"
fi
- name: Upload coverage
if: inputs.upload-coverage != 'false'
uses: coverallsapp/github-action@v2
env:
COVERALLS_REPO_TOKEN: ${{ inputs.coveralls-repo-token }}

0 comments on commit 6d966e5

Please sign in to comment.