2021-03-10 11:39:26 +00:00
|
|
|
name: Testing
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ["*"]
|
|
|
|
tags-ignore: ["*"]
|
|
|
|
pull_request:
|
2021-04-07 01:51:36 +00:00
|
|
|
types: [opened, synchronize, reopened]
|
2021-03-10 11:39:26 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2021-04-07 11:27:30 +00:00
|
|
|
name: Tests and style checks
|
2021-03-10 11:39:26 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-27 13:17:38 +00:00
|
|
|
python-version: [3.8, 3.9, 3.11]
|
2021-03-10 11:39:26 +00:00
|
|
|
steps:
|
2023-07-28 13:26:50 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-03-10 11:39:26 +00:00
|
|
|
- name: Install python ${{ matrix.python-version }}
|
2023-07-28 13:26:50 +00:00
|
|
|
uses: actions/setup-python@v4
|
2021-03-10 11:39:26 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-07-21 16:27:33 +00:00
|
|
|
python -m pip install --upgrade pip setuptools twine wheel
|
2021-03-10 11:39:26 +00:00
|
|
|
python -m pip install '.[dev]'
|
|
|
|
python -m pip install -e .
|
|
|
|
- name: Lint
|
|
|
|
run: |
|
2021-07-21 16:27:33 +00:00
|
|
|
flake8 sprockets_statsd tests setup.py docs/conf.py
|
2021-03-10 11:39:26 +00:00
|
|
|
- name: Check format
|
|
|
|
run: |
|
2021-07-21 16:27:33 +00:00
|
|
|
yapf -dr sprockets_statsd tests setup.py docs/conf.py
|
|
|
|
- name: Verify distribution build
|
|
|
|
run: |
|
|
|
|
rm -fr dist
|
|
|
|
python setup.py bdist_wheel
|
|
|
|
python setup.py sdist
|
|
|
|
twine check dist/*
|
2021-03-10 11:39:26 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
coverage run -m unittest
|
|
|
|
coverage report
|
2021-03-30 12:24:25 +00:00
|
|
|
coverage xml -o ./coverage.xml
|
2021-04-07 11:27:30 +00:00
|
|
|
- name: Send coverage to codecov.io
|
2023-07-28 13:26:50 +00:00
|
|
|
uses: codecov/codecov-action@v3.1.4
|
2021-03-30 12:24:25 +00:00
|
|
|
with:
|
2021-04-07 01:25:46 +00:00
|
|
|
token: ${{secrets.CODECOV_TOKEN}}
|
2021-03-30 12:24:25 +00:00
|
|
|
file: ./coverage.xml
|
|
|
|
flags: unittests
|
|
|
|
fail_ci_if_error: true
|
2021-04-07 11:27:30 +00:00
|
|
|
- name: Save coverage report
|
2021-04-07 11:35:03 +00:00
|
|
|
if: ${{ matrix.python-version == '3.9' }}
|
2023-07-28 13:26:50 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-04-07 11:27:30 +00:00
|
|
|
with:
|
|
|
|
name: coverage.xml
|
|
|
|
path: ./coverage.xml
|