Skip to content

Commit

Permalink
Merge 073f501 into 1fde21e
Browse files Browse the repository at this point in the history
  • Loading branch information
sajith authored Dec 16, 2022
2 parents 1fde21e + 073f501 commit 8b0ba81
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
47 changes: 29 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,31 @@ on:
branches: [ "main" ]

jobs:
build:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version:
- "3.8"
- "3.9"
- "3.10"

steps:
- name: Check out sources
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

# See https://github.com/marketplace/actions/cache
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Set up pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: 'pip' # caching pip dependencies

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 tox black
python -m pip install flake8 tox black coveralls
- name: Run code formatting checks with black
run: |
Expand All @@ -65,3 +55,24 @@ jobs:
SDXCONTROLLER_HOST: 'localhost'
SDXCONTROLLER_PORT: '8080'
SDXCONTROLLER_VERSION: '1.0.0'

- name: Send coverage data to coveralls.io
run: |
python -m coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true

finalize:
name: finalize
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Indicate completion to coveralls.io
run: |
pip --no-cache-dir install --upgrade coveralls
python -m coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
coverage>=4.0.3
pytest>=7.1.3
pytest-cov>=4.0.0
pluggy>=0.3.1
py>=1.4.31
randomize>=0.13
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
passenv = SDXCONTROLLER_*
commands =
pytest {posargs}
pytest --cov swagger_client {posargs}

0 comments on commit 8b0ba81

Please sign in to comment.