feat(SXMC-653): Add codefreeze job #211
Workflow file for this run
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
name: Python 3 Tests | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
static_analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- uses: actions/checkout@v2 | |
- name: Lint - flake8 | |
run: | | |
pip install flake8 | |
# ignore "line break before binary operator", and "invalid escape sequence '\_'" useful for doc | |
flake8 --count --ignore=W503,W605 --show-source --statistics pandagg | |
# on tests, more laxist: allow "missing whitespace after ','" and "line too long" | |
flake8 --count --ignore=W503,W605,E231,E501 --show-source --statistics tests | |
- name: Format - black | |
run: | | |
pip install black | |
black --check . | |
- name: Mypy check | |
run: | | |
pip install mypy | |
pip install -e ".[develop]" | |
mypy --install-types --non-interactive pandagg | |
run_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
env: | |
PYTHON: ${{ matrix.python-version }} | |
OS: 'ubuntu-latest' | |
services: | |
elasticsearch: | |
image: elasticsearch:7.14.0 | |
env: | |
discovery.type: single-node | |
ES_JAVA_OPTS: -Xms1g -Xmx1g | |
ports: | |
- 9200:9200 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up 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 | |
pip install -e ".[develop]" | |
- name: Test with pytest and generate coverage report | |
env: | |
ELASTICSEARCH_URL: localhost:9200 | |
run: | |
pytest --cov=./pandagg --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./coverage.xml | |
env_vars: OS,PYTHON | |
fail_ci_if_error: true |