-
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.
Added setup for CI runs on GitHub Actions
Details: * Created a Github Actions workflow file test.yml that triggers a test job for each pull/pr and runs the same actions as in Travis. It also runs a finish job that completes the coverage combination for coveralls.io. Python 3.4 had to be disabled on Windows and macOS. * Added a badge for GitHub Actions test workflow result to the README page. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
- Loading branch information
1 parent
cac51c2
commit 8b5e815
Showing
5 changed files
with
126 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,119 @@ | ||
# This GitHub workflow will setup and run various kinds of tests with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: test | ||
|
||
on: | ||
# schedule: | ||
# # minute hour day_of_month month day_of_week | ||
# - cron: '10 21 * * 0' # Every sunday at 21:10 UTC | ||
push: | ||
branches: [ master, stable_0.8 ] | ||
pull_request: | ||
branches: [ master, stable_0.8 ] | ||
|
||
jobs: | ||
|
||
test: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 20 | ||
# # The matrix for the all-environment pull request: | ||
# matrix: | ||
# os: [ubuntu-latest, macos-latest] # TODO: Add windows-latest | ||
# python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] | ||
# package_level: [minimum, latest] | ||
# The matrix for normal pull requests: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [2.7, 3.5, 3.9] | ||
package_level: [minimum, latest] | ||
include: | ||
- os: macos-latest | ||
python-version: 3.9 | ||
package_level: latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Rebase manual-ci-run to master | ||
if: ${{ github.head_ref == 'manual-ci-run' }} | ||
run: | | ||
echo "Fetching and defining master:" | ||
git fetch origin master | ||
git branch master FETCH_HEAD | ||
echo "Log back to master:" | ||
git log master~..HEAD --oneline --decorate | ||
echo "Rebasing to master:" | ||
git rebase master | ||
echo "Log back to master:" | ||
git log master~..HEAD --oneline --decorate | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Display initial Python packages | ||
run: | | ||
echo "Installed Python packages:" | ||
pip list | ||
- name: Install the package and its dependents | ||
env: | ||
PACKAGE_LEVEL: ${{ matrix.package_level }} | ||
run: | | ||
make install | ||
echo "Installed Python packages:" | ||
pip list | ||
- name: Development setup | ||
env: | ||
PACKAGE_LEVEL: ${{ matrix.package_level }} | ||
run: | | ||
make develop | ||
echo "Installed Python packages:" | ||
pip list | ||
- name: Run sanity | ||
# Note: make sanity is excluded on Ansible 2.9 and Python 3.9 because it is not supported. | ||
if: ${{ ! (matrix.package_level == 'minimum' || matrix.python-version == '3.9') }} | ||
env: | ||
PACKAGE_LEVEL: ${{ matrix.package_level }} | ||
run: | | ||
make sanity | ||
- name: Run doccheck | ||
if: ${{ matrix.package_level == 'latest' && matrix.python-version == '3.9' }} | ||
env: | ||
PACKAGE_LEVEL: ${{ matrix.package_level }} | ||
run: | | ||
make doccheck | ||
- name: Run docs | ||
env: | ||
PACKAGE_LEVEL: ${{ matrix.package_level }} | ||
run: | | ||
make docs | ||
- name: Run test | ||
env: | ||
PACKAGE_LEVEL: ${{ matrix.package_level }} | ||
# TESTCASES: test_partition.py | ||
run: | | ||
make test | ||
- name: Send coverage result to coveralls.io | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_PARALLEL: true | ||
COVERALLS_FLAG_NAME: "${{ matrix.os }},${{ matrix.python-version }},${{ matrix.package_level }}" | ||
run: | | ||
coveralls | ||
test_finish: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
container: python:3-slim | ||
steps: | ||
- name: Install coveralls | ||
run: | | ||
pip3 install --upgrade coveralls | ||
- name: Send coverage finish to coveralls.io | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
coveralls --finish |
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
Oops, something went wrong.