Skip to content

Commit

Permalink
chore: add workflow actions (#108)
Browse files Browse the repository at this point in the history
* chore: add steps to CI workflow to upload coverage report

* chore: add actions for issues and PRs

* chore: add actions for issues and PRs

* chore: remove stray '-' in workflow step
  • Loading branch information
weibullguy authored Aug 11, 2022
1 parent 0b6d35e commit 9b9c501
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ jobs:
- name: Run tests with tox
run: |
tox -e py
- name: Create Coveralls report
uses: miurahr/coveralls-python-action@patch-pyprject-toml
with:
parallel: true

upload_coveralls:
name: Upload Results to Coveralls
needs: test
runs-on: ubuntu-latest
steps:
- name: Upload coverage report to Coveralls
uses: miurahr/coveralls-python-action@patch-pyprject-toml
with:
parallel-finished: true
14 changes: 14 additions & 0 deletions .github/workflows/on-issue-open.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Issue Open Workflow

on:
issues:
types: [opened, edited]

jobs:
label_issue_backlog:
runs-on: ubuntu-latest
steps:
- name: Add fresh new label
uses: andymckay/labeler@master
with:
add-labels: "fresh"
75 changes: 75 additions & 0 deletions .github/workflows/on-push-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This workflow runs when a version tag is pushed.
#
# - Job 1:
# - Get new tag.
# - Update CHANGELOG.md
# - Update VERSION, pyproject.toml, and docs/conf.py with new version.
# - Set PR variables.
# - Cut PR to merge files and create release/* branch.
name: Push Version Tag Workflow

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
request-release:
name: Request Release PR
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master

- name: Get new tag
id: newversion
run: |
new_tag=${GITHUB_REF/refs\/tags\//}
echo "::set-output name=new_version::$(echo $new_tag)"
echo "New tag is: $new_tag"
echo "GitHub ref: ${{ github.ref }}"
- name: Generate release changelog
uses: heinrichreimer/github-changelog-generator-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: "v1.3.1"
excludeTags: "latest"
breakingLabel: "Breaking Changes"
breakingLabels: "V: major"
enhancementLabel: "New Features"
enhancementLabels: "V: minor"
bugsLabel: "Bug Fixes"
bugLabels: "V: patch"
excludeLabels: "release"
issues: false
issuesWoLabels: false
maxIssues: 100
pullRequests: true
prWoLabels: false
author: true
unreleased: true
compareLink: true
stripGeneratorNotice: true
verbose: true

- name: Update VERSION, pyproject.toml, and docs/conf.py
uses: vemel/nextversion@main
with:
path: ./pyproject.toml
result: ${{ steps.newversion.outputs.new_version }}
update: |
./pyproject.toml
- name: Request release pull request
uses: peter-evans/create-pull-request@v3
with:
commit-message: "release: ${{ steps.newversion.outputs.new_version }}"
title: "release: ${{ steps.newversion.outputs.new_version }}"
body: "Please cut release ${{ steps.newversion.outputs.new_version }}"
branch: "release/${{ steps.newversion.outputs.new_version }}"
base: master
labels: release
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ untokenize = "^0.1.1"
pydocstyle = "^6.1.1"
pylint = "^2.12.0"
pycodestyle = "^2.8.0"
coverage = "^6.2.0"
coverage = {extras = ["toml"], version = "^6.2.0"}
rstcheck = "<6.0.0"
pytest = "<7.0.0"
pytest-cov = "^3.0.0"
Expand Down

0 comments on commit 9b9c501

Please sign in to comment.