-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Python application | ||
name: Tests and QA | ||
|
||
on: | ||
push: | ||
|
@@ -13,29 +13,57 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction --with dev | ||
|
||
- name: Run linters | ||
run: | | ||
poetry install | ||
poetry run black --check . | ||
- name: Build contracts | ||
run: | | ||
bash tests/build_contracts.sh | ||
- name: Test with pytest | ||
run: | | ||
poetry run pytest --cov-report xml:coverage.xml | ||
- name: Upload coverage.xml | ||
uses: orgoro/[email protected] | ||
with: | ||
coverageFile: coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
poetry run coverage run -m pytest | ||
# add further tests with `poetry run coverage run -a ...` | ||
- name: Upload coverage data to coveralls.io | ||
run: poetry run coveralls | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | ||
COVERALLS_PARALLEL: true | ||
|
||
|
||
coveralls: | ||
name: Indicate completion to coveralls.io | ||
needs: test | ||
runs-on: ubuntu-latest | ||
container: python:3-slim | ||
steps: | ||
- name: Install coveralls | ||
run: pip3 install --upgrade coveralls | ||
- name: Finished | ||
run: coveralls --finish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |