-
Notifications
You must be signed in to change notification settings - Fork 64
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 #487 from moble/github_actions
Add github actions CI
- Loading branch information
Showing
13 changed files
with
132 additions
and
53 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
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,89 @@ | ||
name: Python CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: ['*'] | ||
pull_request: | ||
|
||
concurrency: | ||
group: test-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHONUNBUFFERED: "1" | ||
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
build: | ||
name: Python ${{ matrix.python-version }} ${{ matrix.extra-env }} | ||
if: >- | ||
!contains(github.event.head_commit.message, '[skip ci]') | ||
&& !contains(github.event.head_commit.message, '[skip tests]') | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -r test_requirements.txt | ||
python -m pip install -e . | ||
python -m pip check | ||
- name: Lint | ||
run: | | ||
flake8 -v | ||
- name: Test | ||
run: | | ||
PYTEST_ARGS=(); | ||
PYTEST_ARGS+=(-n 2 --dist loadscope); | ||
if [[ ! -z "$PYTEST_K_FILTER" ]]; then | ||
PYTEST_ARGS+=(-k "$PYTEST_K_FILTER"); | ||
fi; | ||
pytest \ | ||
--cov=galgebra \ | ||
--nbval examples/ipython/ \ | ||
test \ | ||
--current-env \ | ||
--sanitize-with test/.nbval_sanitize.cfg \ | ||
"${PYTEST_ARGS[@]}" | ||
- name: Upload coverage to Codecov | ||
if: "matrix.python-version == '3.11'" | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
release: | ||
name: Create release and send to PyPI | ||
needs: build | ||
if: >- | ||
github.ref_type == 'tag' | ||
&& startsWith(github.ref, 'refs/tags/v') | ||
&& !contains(github.event.head_commit.message, '[skip ci]') | ||
&& !contains(github.event.head_commit.message, '[no release]') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install wheel | ||
run: | | ||
python -m pip install wheel | ||
- name: Build and upload package | ||
if: success() | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
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,11 @@ | ||
version: 2 | ||
build: | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "3.11" | ||
|
||
python: | ||
install: | ||
- requirements: doc/readthedocs-pip-requirements.txt | ||
- method: pip | ||
path: . |
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 was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -3,9 +3,9 @@ ipython | |
matplotlib | ||
scipy | ||
|
||
# an unreleased commit that will eventually make the 3.1.0 release, with | ||
# type annotations which work on cached_property | ||
-e git+https://[email protected]/sphinx-doc/sphinx.git@5460ad6925199b57b27b7d059825d3560872edbb#egg=sphinx | ||
## an unreleased commit that will eventually make the 3.1.0 release, with | ||
## type annotations which work on cached_property | ||
#-e git+https://[email protected]/sphinx-doc/sphinx.git@5460ad6925199b57b27b7d059825d3560872edbb#egg=sphinx | ||
|
||
ipykernel | ||
nbsphinx | ||
|
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 was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# requirements for CI | ||
wheel | ||
sympy == 1.7 | ||
flake8 | ||
pytest-cov | ||
ipython == 5.8.0; python_version == "2.7" | ||
nbval | ||
|