-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Publish mkdocs to github action on every update * Publish mkdocs to github action on every update * Run linters and tests for each push * Add release flow with publishing to pypi * Extend python matrix * Add names for jobs * Use script instead of direct run * Remove fail-fast for matrix run * Few fixes Co-authored-by: Ivan Dmitrievsky <ivan.dmitrievsky@gmail.com>
- Loading branch information
1 parent
82aa126
commit 65a1bd2
Showing
10 changed files
with
231 additions
and
3 deletions.
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,46 @@ | ||
name: Checks | ||
on: | ||
push: | ||
|
||
jobs: | ||
run-checks: | ||
name: Run checks 🧪 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: | ||
- '3.7' | ||
- '3.8' | ||
- '3.9' | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python }} | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 🐍 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Cache Poetry virtualenv 💾 | ||
uses: actions/cache@v1 | ||
id: poetry-cache | ||
with: | ||
path: .venv | ||
key: poetry-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry 📖 | ||
run: | | ||
pip install poetry | ||
poetry config virtualenvs.in-project true | ||
- name: Install dependencies 📌 | ||
if: steps.poetry-cache.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install | ||
- name: Run checks 🧪 | ||
run: | | ||
poetry run scripts/test.sh |
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,108 @@ | ||
name: Docs | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
PYTHON_VERSION: 3.9 | ||
|
||
jobs: | ||
build-docs: | ||
name: Build docs 🏗 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 🐍 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Cache Poetry virtualenv 💾 | ||
uses: actions/cache@v1 | ||
id: poetry-cache | ||
with: | ||
path: .venv | ||
key: poetry-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry 📖 | ||
run: | | ||
pip install poetry | ||
poetry config virtualenvs.in-project true | ||
- name: Install dependencies 📌 | ||
if: steps.poetry-cache.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install | ||
- name: Build docs 🏗 | ||
run: | | ||
poetry run scripts/docs-build.sh | ||
- name: Upload build to artifact ☁️ | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: mkdocs-build | ||
path: site | ||
if-no-files-found: error | ||
|
||
deploy-docs-prod: | ||
name: Deploy docs to Pages 🧐 | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
needs: | ||
- build-docs | ||
steps: | ||
- name: Download build from artifact 🌨 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: mkdocs-build | ||
|
||
- name: Deploy docs to Pages 🧐 | ||
uses: JamesIves/github-pages-deploy-action@4.1.1 | ||
with: | ||
branch: gh-pages | ||
folder: mkdocs-build | ||
|
||
|
||
deploy-docs-preview: | ||
name: Deploy docs to Surge 🧐 [preview] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
needs: | ||
- build-docs | ||
steps: | ||
- name: Download build from artifact 🌨 | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: mkdocs-build | ||
|
||
- name: Publish to Surge 🧐 [preview] | ||
id: publish-preview | ||
env: | ||
SURGE_LOGIN: dev@eventual.com | ||
SURGE_TOKEN: 5ed7fcac90fac92170a28e638c01219b | ||
run: | | ||
pr_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | ||
deploy_host="${pr_number}-eventual-review.surge.sh" | ||
npx surge mkdocs-build $deploy_host | ||
echo "::set-output name=deploy-url::https://$deploy_host" | ||
- name: Find existing comment 🔎 | ||
id: find-comment | ||
uses: peter-evans/find-comment@v1 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: preview version of docs | ||
|
||
- name: Comment PR ✨ | ||
if: steps.find-comment.outputs.comment-id == '' | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
This is a preview version of docs: ${{ steps.publish-preview.outputs.deploy-url }} |
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,56 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- 'published' | ||
|
||
env: | ||
PYTHON_VERSION: 3.9 | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build and publish package 📦 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 🐍 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Cache Poetry virtualenv 💾 | ||
uses: actions/cache@v1 | ||
id: poetry-cache | ||
with: | ||
path: .venv | ||
key: poetry-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry 📖 | ||
run: | | ||
pip install poetry | ||
poetry config virtualenvs.in-project true | ||
- name: Install dependencies 📌 | ||
if: steps.poetry-cache.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install | ||
- name: Build package 📦 | ||
run: | | ||
poetry run scripts/build.sh | ||
- name: Upload package build to artifacts ☁️ | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: package | ||
path: dist | ||
if-no-files-found: error | ||
|
||
- name: Publish package ⬆️ | ||
run: | | ||
poetry run scripts/publish.sh | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ | |
set -x | ||
|
||
poetry build | ||
mkdocs build |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
set -x | ||
|
||
coverage report --show-missing --skip-covered --fail-under=100 | ||
coverage report |
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,5 @@ | ||
#!/bin/sh -e | ||
|
||
set -x | ||
|
||
mkdocs build |
File renamed without changes.
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,5 @@ | ||
#!/bin/sh -e | ||
|
||
set -x | ||
|
||
poetry publish |
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 |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
set -ex | ||
|
||
scripts/check.sh | ||
coverage run -m pytest | ||
coverage run -m pytest tests | ||
scripts/coverage.sh |
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