Skip to content

Commit

Permalink
Added setup for CI runs on GitHub Actions
Browse files Browse the repository at this point in the history
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
andy-maier committed Nov 22, 2020
1 parent cac51c2 commit 8b5e815
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 1 deletion.
119 changes: 119 additions & 0 deletions .github/workflows/test.yml
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
# ibm.zhmc Ansible Galaxy collection

[![Github Release](https://img.shields.io/github/v/release/zhmcclient/zhmc-ansible-modules)](https://github.com/zhmcclient/zhmc-ansible-modules/releases)
[![Github Actions](https://github.com/pywbem/pywbem/workflows/test/badge.svg?branch=master)](https://github.com/pywbem/pywbem/actions/)
[![Ansible Galaxy](https://img.shields.io/badge/galaxy-ibm.zhmc-660198.svg?style=flat)](https://galaxy.ansible.com/ibm/zhmc/)
[![Coveralls Result](https://img.shields.io/coveralls/zhmcclient/zhmc-ansible-modules.svg)](https://coveralls.io/github/zhmcclient/zhmc-ansible-modules)

Expand Down
2 changes: 2 additions & 0 deletions docs/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ <h2>Version 1.0.0-dev1<a class="headerlink" href="#version-1-0-0-dev1" title="Pe
the ‘vlan_type’, ‘function_number’ and ‘function_range’ properties.</p></li>
<li><p>Added support in the zhmc_crypto_attachment module for specifying crypto
adapters by name instead of just their count. (See issue #187)</p></li>
<li><p>Migrated from Travis and Appveyor to GitHub Actions. This required several
changes in package dependencies for development.</p></li>
</ul>
<p><strong>Cleanup:</strong></p>
<ul class="simple">
Expand Down
Loading

0 comments on commit 8b5e815

Please sign in to comment.