Skip to content

Updated CI to support pull request, as I am gonna merge pull request… #10

Updated CI to support pull request, as I am gonna merge pull request…

Updated CI to support pull request, as I am gonna merge pull request… #10

Workflow file for this run

name: ci-cd
on: [push, pull_request]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Check-out repository
uses: actions/checkout@v3
- name: Install poetry
uses: snok/install-poetry@v1
- name: Install package
run: poetry install
- name: Mypy type check
run: poetry run mypy .
- name: Test with pytest
run: poetry run pytest tests/ --cov=provenaclient --cov-report=xml
- name: Use Codecov to track coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
- name: Build documentation
run: poetry run make html --directory docs/
cd:
permissions:
id-token: write
contents: write
needs: ci
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/inital-branch')
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Check-out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Python Semantic Release to prepare release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'
with:
repository-url: https://test.pypi.org/legacy/
- name: Test install from TestPyPI
if: steps.release.outputs.released == 'true'
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
provenaclient
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'
- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}