-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR migrates our CI/CD from Travis to Github Actions. Instead of one deployment, I split into three workflows: - Run the test suite on every push, in every branch - Deploy to pypi when the default branch (master in our case) receives a new commit and has a diepvries/* tag - Build and deploy docs to Github Pages when the default branch receives a new commit and has a diepvries/* tag To enable this, I changed the following repository settings: - Added TWINE_PASSWORD to the repository secrets. - Changed Github Pages deployment source from the gh-pages branch to Github Actions.
- Loading branch information
1 parent
9c210d8
commit 5ccad50
Showing
5 changed files
with
98 additions
and
34 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,45 @@ | ||
name: pages-build-and-deploy | ||
|
||
# Only run this workflow when a diepvries/* tag gets pushed | ||
on: | ||
push: | ||
tags: | ||
- diepvries/* | ||
|
||
jobs: | ||
deploy-github-pages: | ||
runs-on: ubuntu-22.04 | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4.2.0 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y graphviz | ||
python -m pip install tox | ||
- name: Run tox | ||
run: python -m tox -e doc | ||
- name: Configure Pages | ||
uses: actions/configure-pages@v1.1.0 | ||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@v1.0.3 | ||
with: | ||
path: doc/html | ||
- name: Deploy GitHub Pages site | ||
id: deployment | ||
uses: actions/deploy-pages@v1.0.8 |
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,29 @@ | ||
name: pypi-build-and-deploy | ||
|
||
# Only run this workflow when a diepvries/* tag gets pushed | ||
on: | ||
push: | ||
tags: | ||
- diepvries/* | ||
|
||
jobs: | ||
deploy-to-pypi: | ||
runs-on: ubuntu-22.04 | ||
|
||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4.2.0 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: python -m pip install tox | ||
- name: Run tox | ||
run: python -m tox -e build -e upload |
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,22 @@ | ||
name: run-test-suite | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9"] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4.2.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: python -m pip install tox | ||
- name: Run tests | ||
run: python -m tox -e py -e lint |
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