-
Notifications
You must be signed in to change notification settings - Fork 5
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
c3e86d8
commit c3fd119
Showing
2 changed files
with
88 additions
and
88 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,88 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
Linting: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Linting | ||
run: | | ||
pip install pre-commit | ||
pre-commit run --all-files | ||
|
||
Tests: | ||
needs: Linting | ||
name: ${{ matrix.os }} / ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
matrix: | ||
os: [Ubuntu, MacOS] | ||
python-version: [3.9, "3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get full Python version | ||
id: full-python-version | ||
shell: bash | ||
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | ||
|
||
- name: Install poetry | ||
shell: bash | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python - --preview | ||
|
||
- name: Update PATH | ||
shell: bash | ||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Configure poetry | ||
shell: bash | ||
run: poetry config virtualenvs.in-project true | ||
|
||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Ensure cache is healthy | ||
if: steps.cache.outputs.cache-hit == 'true' | ||
shell: bash | ||
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv | ||
|
||
- name: Install test dependencies | ||
shell: bash | ||
run: poetry install --with test --extras fit --extras viz | ||
|
||
# - name: Test | ||
# shell: bash | ||
# run: poetry run pytest -q tests |
This file was deleted.
Oops, something went wrong.