-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
0022835
commit 5e152fa
Showing
3 changed files
with
72 additions
and
36 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Test & Lint | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Display Python version | ||
run: python -c "import sys; print(f'Python {sys.version} on {sys.platform}')" | ||
|
||
- name: Install Linux dependencies | ||
run: | | ||
./.github/ubuntu-install.sh | ||
- name: Install Poetry | ||
uses: dschep/install-poetry-action@v1.2 | ||
|
||
- name: Cache Poetry virtualenv | ||
uses: actions/cache@v1 | ||
id: cache | ||
with: | ||
path: ~/.virtualenvs | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('poetry.lock') }} | ||
- name: Set Poetry config | ||
run: | | ||
poetry config virtualenvs.in-project false | ||
poetry config virtualenvs.path ~/.virtualenvs | ||
- name: Install Dependencies (with Lint) | ||
run: poetry install --no-dev -E tests -E lint | ||
|
||
- name: Lint with flake8 | ||
run: "poetry run flake8 ." | ||
|
||
- name: Check Formatting with Black | ||
run: "poetry run black . --check" | ||
|
||
- name: Static type-check with MyPy | ||
run: "poetry run mypy typic --ignore-missing-imports" | ||
|
||
- name: Test with pytest + coverage | ||
run: "poetry run pytest tests typic --doctest-modules --cov --cov-report xml" | ||
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest' | ||
|
||
- name: Upload coverage to Codecov | ||
if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest' | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
flags: unittests,${{ matrix.python-version }} | ||
name: codecov-umbrella | ||
fail_ci_if_error: false |
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
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