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:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [3.7, 3.8, 3.9]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip setuptools
|
|
|
|
python -m pip install '.[dev]'
|
|
|
|
python -m pip install -e .
|
|
|
|
- name: Lint
|
|
|
|
run: |
|
|
|
|
flake8 sprockets_statsd tests
|
|
|
|
- name: Check format
|
|
|
|
run: |
|
|
|
|
yapf -dr sprockets_statsd tests
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
coverage run -m unittest
|
|
|
|
coverage report
|
2021-03-30 12:24:25 +00:00
|
|
|
coverage xml -o ./coverage.xml
|
|
|
|
- name: Upload coverage
|
2021-04-07 01:25:46 +00:00
|
|
|
uses: codecov/codecov-action@v1.3.2
|
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 01:25:46 +00:00
|
|
|
verbose: true
|
2021-04-07 01:51:36 +00:00
|
|
|
sonarcloud:
|
|
|
|
name: SonarCloud
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
|
|
- name: SonarCloud Scan
|
|
|
|
uses: SonarSource/sonarcloud-github-action@master
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|