Docker build prints outputs to stdout by default if loglevel <= INFO #101
Workflow file for this run
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
name: CI/CD | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: [published] | |
defaults: | |
run: | |
shell: bash | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] # , macos-latest, windows-latest] | |
python-version: ["3.8", "3.12"] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Unset header | |
# checkout@v2 adds a header that makes branch protection report errors | |
# because the Github action bot is not a collaborator on the repo | |
run: git config --local --unset http.https://github.com/.extraheader | |
- name: Fetch tags | |
run: git fetch --prune --unshallow | |
- name: Disable etelemetry | |
run: echo "NO_ET=TRUE" >> $GITHUB_ENV | |
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Update build tools | |
run: python3 -m pip install --break-system-packages --upgrade pip | |
- name: Install Package | |
run: python3 -m pip install --break-system-packages -e .[test] | |
- name: Change out of root directory | |
run: cd docs | |
- name: Pytest | |
run: pytest -vvs --cov pipeline2app --cov-config .coveragerc --cov-report xml . | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: false | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# disable fail for now | |
build: | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Unset header | |
# checkout@v2 adds a header that makes branch protection report errors | |
# because the Github action bot is not a collaborator on the repo | |
run: git config --local --unset http.https://github.com/.extraheader | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install build tools | |
run: python3 -m pip install --break-system-packages build twine | |
- name: Build source and wheel distributions | |
run: python3 -m build | |
- name: Check distributions | |
run: twine check dist/* | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: built-pkg | |
path: dist | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Unset header | |
# checkout@v2 adds a header that makes branch protection report errors | |
# because the Github action bot is not a collaborator on the repo | |
run: git config --local --unset http.https://github.com/.extraheader | |
- name: Fetch tags | |
run: git fetch --prune --unshallow | |
- name: Configure GitHub Pages | |
uses: actions/configure-pages@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --break-system-packages --upgrade pip | |
pip install .[docs] | |
- name: Build documentation | |
run: | | |
cd docs | |
make html | |
cd .. | |
- name: Upload Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/build/html | |
deploy: | |
needs: [build] # , build-docs] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download build | |
uses: actions/download-artifact@v3 | |
with: | |
name: built-pkg | |
path: dist | |
- name: Check for PyPI token on tag | |
id: deployable | |
if: github.event_name == 'release' | |
env: | |
PYPI_API_TOKEN: "${{ secrets.PYPI_API_TOKEN }}" | |
run: if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi | |
- name: Upload to PyPI | |
if: steps.deployable.outputs.DEPLOY | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
deploy-docs: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
if: github.event_name == 'release' | |
needs: [build, build-docs] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
# Deploy on tags if PYPI_API_TOKEN is defined in the repository secrets. | |
# Secrets are not accessible in the if: condition [0], so set an output variable [1] | |
# [0] https://github.community/t/16928 | |
# [1] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter |