-
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.
Merge pull request #6 from gpongelli/complete_workflow
Complete workflow
- Loading branch information
Showing
8 changed files
with
1,592 additions
and
1,034 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 |
---|---|---|
|
@@ -11,62 +11,167 @@ on: | |
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: [ master, main ] | ||
tags: | ||
- '*.*.*' | ||
pull_request: | ||
branches: [ master, main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "test" | ||
test: | ||
# The type of runner that the job will run on | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-versions: [3.8, 3.9, "3.10", "3.11"] | ||
python-version: [ "3.8", "3.9", "3.10", "3.11" ] | ||
poetry-version: [ "1.3" ] | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | ||
os: [ubuntu-20.04, ubuntu-22.04] # dependency issues on macos-latest and windows-latest | ||
os: [ubuntu-latest, windows-latest, macos-latest] # dependency issues on macos-latest and windows-latest | ||
runs-on: ${{ matrix.os }} | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages | ||
- name: Install Poetry | ||
run: pipx install poetry | ||
|
||
# https://github.com/actions/setup-python | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
python-version: ${{ matrix.python-versions }} | ||
cache: 'poetry' | ||
poetry-version: ${{ matrix.poetry-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
poetry install --with devel --sync | ||
python -m pip install --upgrade pip setuptools | ||
poetry install --with devel --sync | ||
# pip install poetry tox tox-gh-actions | ||
|
||
- name: build documentation | ||
run: poetry run tox -e docs | ||
run: poetry run tox --skip-pkg-install -e docs | ||
|
||
- name: linter checks with tox | ||
run: | ||
poetry run tox -e lint | ||
poetry run tox --skip-pkg-install -e lint | ||
|
||
- name: test with tox | ||
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context | ||
- name: test with tox - Windows | ||
if: runner.os == 'Windows' | ||
run: | ||
poetry run tox -e py${{ matrix.python-versions }} | ||
poetry run tox --skip-pkg-install -e py${{ matrix.python-version }}-win | ||
|
||
- name: test with tox - Linux | ||
if: runner.os == 'Linux' | ||
run: | ||
poetry run tox --skip-pkg-install -e py${{ matrix.python-version }}-lin | ||
|
||
- name: test with tox - MacOS | ||
if: runner.os == 'macOS' | ||
run: | ||
poetry run tox --skip-pkg-install -e py${{ matrix.python-version }}-mac | ||
|
||
- name: list files | ||
run: ls -l . | ||
|
||
# https://github.com/codecov/codecov-action | ||
# Easily upload coverage reports to Codecov from GitHub Actions | ||
- uses: codecov/codecov-action@v3 | ||
if: runner.os == 'macOS' | ||
with: | ||
fail_ci_if_error: true | ||
files: ./xml_coverage_py${{ matrix.python-versions }}.xml | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./xml_coverage_py${{ matrix.python-version }}-mac.xml | ||
|
||
# This workflow contains a single job called "release" | ||
release: | ||
needs: [ test ] | ||
name: Create Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
matrix: | ||
python-version: [ "3.11" ] | ||
poetry-version: [ "1.3" ] | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
# https://github.com/BinPar/read-conventional-commit-changelog | ||
- name: Get Changelog Entry | ||
id: changelog | ||
uses: BinPar/[email protected] | ||
|
||
# https://github.com/actions/setup-python | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
poetry install --with devel --sync | ||
# Build and publish documentation | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v2 | ||
|
||
- name: build documentation | ||
run: poetry run tox --skip-pkg-install -e docs | ||
|
||
- name: Upload doc artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: './docs/build/html' | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 | ||
|
||
- name: Build wheels and source tarball | ||
run: >- | ||
poetry build | ||
- name: show temporary files | ||
run: >- | ||
ls -l | ||
# https://github.com/softprops/action-gh-release | ||
- name: create github release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
token: ${{ secrets.make_gh_release_token }} | ||
body: ${{ steps.changelog.outputs.version-changelog }} | ||
files: dist/*.whl | ||
draft: false | ||
prerelease: false | ||
|
||
# https://github.com/pypa/gh-action-pypi-publish | ||
- name: publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: ${{ secrets.pypi_username }} | ||
password: ${{ secrets.pypi_password }} | ||
skip_existing: 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
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 |
---|---|---|
|
@@ -27,11 +27,12 @@ jobs: | |
# This workflow contains a single job called "release" | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
matrix: | ||
python-versions: [3.9] | ||
python-version: [ "3.11" ] | ||
poetry-version: [ "1.3" ] | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
|
@@ -43,15 +44,15 @@ jobs: | |
id: changelog | ||
uses: BinPar/[email protected] | ||
|
||
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages | ||
- name: Install Poetry | ||
run: pipx install poetry | ||
|
||
# https://github.com/actions/setup-python | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-versions }} | ||
cache: 'poetry' | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
|
@@ -63,7 +64,7 @@ jobs: | |
uses: actions/configure-pages@v2 | ||
|
||
- name: build documentation | ||
run: poetry run tox -e docs | ||
run: poetry run tox --skip-pkg-install -e docs | ||
|
||
- name: Upload doc artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
|
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.