Merge pull request #21 from emirkmo/emirkmo-patch-1 #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python tests | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: write-all | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up Python 3.10 | |
uses: actions/[email protected] | |
with: | |
python-version: "3.10" | |
cache: pip | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f dev-requirements.txt ]; then pip install -r dev-requirements.txt; fi | |
- name: Test with pytest | |
run: | | |
python -m pytest rawsight --cache-clear --cov=rawsight | tee pytest-coverage.txt | |
- name: Pytest coverage report | |
id: coverageComment | |
uses: MishaKav/[email protected] | |
with: | |
pytest-coverage-path: ./pytest-coverage.txt | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
default-branch: master | |
- name: create dynamic badge | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: 092a8fbf51f22d7ccf5fc01059f5d5d4 | |
filename: rawsight_badge.json | |
label: Test Coverage | |
message: ${{ steps.coverageComment.outputs.coverage }} | |
color: ${{ steps.coverageComment.outputs.color }} | |
namedLogo: python |