forked from defunkt/pystache
-
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.
Merge pull request #19 from VCTLabs/auto-docs
New docs and automation, more modernization
- Loading branch information
Showing
61 changed files
with
1,142 additions
and
2,043 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
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
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,115 @@ | ||
name: Pylint | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
pylint: | ||
|
||
runs-on: ubuntu-20.04 | ||
defaults: | ||
run: | ||
shell: bash | ||
outputs: | ||
branch: ${{ steps.extract_branch.outputs.branch }} | ||
rating: ${{ steps.analyze.outputs.rating }} | ||
path: ${{ steps.analyze.outputs.path }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Extract base branch name | ||
id: extract_branch | ||
shell: bash | ||
run: | | ||
TMP_PULL_BASE_REF="${{ github.base_ref }}" | ||
TMP_GITHUB_REF="${GITHUB_REF#refs/heads/}" | ||
EXPORT_VALUE="" | ||
if [ "${TMP_PULL_BASE_REF}" != "" ] | ||
then | ||
EXPORT_VALUE="${TMP_PULL_BASE_REF}" | ||
else | ||
EXPORT_VALUE="${TMP_GITHUB_REF}" | ||
fi | ||
echo "##[set-output name=branch;]${EXPORT_VALUE}" | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install tox | ||
run: | | ||
python -m pip install --upgrade pip wheel | ||
pip install tox tox-gh-actions | ||
#- name: Run tox | ||
#run: | | ||
#bash -c 'tox -e lint' | ||
|
||
- name: Run pylint | ||
id: analyze | ||
env: | ||
BADGE_PATH: badges/pylint-score.svg | ||
run: | | ||
rating=$(bash -c 'tox -e lint' | grep 'Your code has been rated at' | cut -f7 -d " ") | ||
echo "Pylint score: ${rating}" | ||
echo "##[set-output name=rating;]${rating}" | ||
echo "##[set-output name=path;]${BADGE_PATH}" | ||
badge: | ||
# Only generate and publish if these conditions are met: | ||
# - The previous job/analyze step ended successfully | ||
# - At least one of these is true: | ||
# - This is a push event and the push event is on branch 'master' or 'develop' | ||
# Note: if this repo is personal (ie, not an org repo) then you can | ||
# use the following to change the scope of the next 2 jobs | ||
# instead of running on branch push as shown below: | ||
# - This is a pull request event and the pull actor is the same as the repo owner | ||
# if: ${{ ( github.event_name == 'pull_request' && github.actor == github.repository_owner ) || github.ref == 'refs/heads/master' }} | ||
name: Generate badge image with pylint score | ||
runs-on: ubuntu-20.04 | ||
needs: [pylint] | ||
if: ${{ github.event_name == 'push' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: badges | ||
path: badges | ||
|
||
# Use the output from the `analyze` step | ||
- name: Create pylint badge | ||
uses: emibcn/badge-action@v1 | ||
id: badge | ||
with: | ||
label: 'Pylint score' | ||
status: ${{ needs.pylint.outputs.rating }} | ||
color: 'green' | ||
path: ${{ needs.pylint.outputs.path }} | ||
|
||
- name: Commit badge | ||
env: | ||
BRANCH: ${{ needs.pylint.outputs.branch }} | ||
FILE: 'pylint-score.svg' | ||
working-directory: ./badges | ||
run: | | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
mkdir -p "${BRANCH}" | ||
mv "${FILE}" "${BRANCH}" | ||
git add "${BRANCH}/${FILE}" | ||
# Will give error if badge has not changed | ||
git commit -m "Add/Update badge" || true | ||
- name: Push badge commit | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: badges | ||
directory: badges |
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,48 @@ | ||
name: Docs | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Add python requirements | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Build docs | ||
run: | | ||
#tox -e docs-lint | ||
tox -e docs | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ApiDocsHTML | ||
path: "docs/_build/html/" | ||
|
||
- name: set nojekyll for github | ||
run: | | ||
sudo touch docs/_build/html/.nojekyll | ||
- name: Deploy docs to gh-pages | ||
if: ${{ github.event_name == 'push' }} | ||
uses: JamesIves/github-pages-deploy-action@3.7.1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: docs/_build/html/ | ||
SINGLE_COMMIT: true |
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.