-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from satellogic/fix-ci
fix(ci): add GitHub Actions
- Loading branch information
Showing
3 changed files
with
78 additions
and
1 deletion.
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,2 @@ | ||
[run] | ||
relative_files = True |
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,75 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "*.md" | ||
|
||
jobs: | ||
build: | ||
# For compatibility with Python 3.4 | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Prepare Environment | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest==3.8.2 | ||
pip install coveralls | ||
pip install -e ".[dev]" | ||
- name: Flake8 | ||
run: | | ||
flake8 quaternions | ||
- name: Tests (3.4) | ||
# Avoid .coveragerc in 3.4 | ||
if: | ||
matrix.python-version == 3.4 | ||
run : | | ||
pytest -v tests/ | ||
- name: Tests | ||
if: | ||
matrix.python-version >= 3.5 | ||
run: | | ||
pytest -v --cov=quaternions --cov-report= tests/ | ||
- name: Publish coverage to Coveralls | ||
# If pushed / is a pull request against main repo | ||
if: | ||
((github.event_name == 'push' && github.repository == 'satellogic/quaternions') || | ||
github.event.pull_request.base.repo.full_name == 'satellogic/quaternions') && matrix.python-version >= 3.5 | ||
uses: AndreMiras/coveralls-python-action@v20201129 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
flag-name: py${{ matrix.python-version }} | ||
parallel: true | ||
debug: true | ||
|
||
coveralls-finish: | ||
needs: build | ||
# If pushed / is a pull request against main repo | ||
if: | ||
(github.event_name == 'push' && github.repository == 'satellogic/quaternions') || | ||
github.event.pull_request.base.repo.full_name == 'satellogic/quaternions' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Coveralls finished | ||
uses: AndreMiras/coveralls-python-action@v20201129 | ||
with: | ||
parallel-finished: true | ||
debug: true |
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