Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nielstron committed Oct 17, 2024
1 parent 7e8104d commit 185c339
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions .github/workflows/python-app.yml
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:
Expand All @@ -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 }}

0 comments on commit 185c339

Please sign in to comment.