-
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.
Test and release with GitHub actions
- Loading branch information
1 parent
fe5c93c
commit 9abf3ac
Showing
4 changed files
with
70 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Test and release | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
test-python: | ||
name: Test Python | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install test dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install '.[tests]' | ||
- name: Run test suite | ||
run: | | ||
pytest | ||
test-r: | ||
name: Test R | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: rlib/actions/setup-r@v1 | ||
- name: Install test dependencies | ||
shell: Rscript {0} | ||
run: | | ||
install.packages(c("remotes", "rcmdcheck")) | ||
remotes::install_deps(dependencies = TRUE) | ||
- name: Run test suite | ||
shell: Rscript {0} | ||
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") | ||
|
||
release: | ||
name: Release to PyPI | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test-python | ||
- test-r | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# Make sure the whole repository history is present, so that | ||
# python-semantic-release can decide if a new release is needed. | ||
fetch-depth: 0 | ||
|
||
- uses: relekang/python-semantic-release@v7 | ||
with: | ||
github_token: ${{ sectrets.GITHUB_TOKEN }} | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
|
||
|
||
|
||
|
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