Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kellerza committed Oct 1, 2024
1 parent e316b2a commit 2ad36de
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 62 deletions.
59 changes: 45 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,11 @@ jobs:
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Run the automated tests (for example)
- name: Install dependencies
run: poetry install -E all
- name: Run pylint
run: poetry run pylint dataplaybook tests

# - name: Upgrade pip
# run: python -m pip install --upgrade pip
# - name: Add pylint
# run: pip install pylint
# - name: Install dataplaybook
# run: pip install ".[mongodb,pptx,tests]"
# - name: Run Pylint
# run: |
# pylint dataplaybook

pytest:
name: Run tests Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -73,11 +63,52 @@ jobs:
run: poetry install -E all

- name: Run tests and generate coverage report
run: pytest --cov=./dataplaybook --cov-report=xml
run: poetry run pytest --cov=./dataplaybook --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON
verbose: true

release:
name: Build and publish Python 🐍 distributions 📦 to PyPI
needs: [pytest]
if: startsWith(github.ref, 'refs/tags')

runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
steps:
- name: Setup | Checkout Repository at workflow sha
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}

- name: Setup | Force correct release branch on workflow sha
run: |
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
- name: Action | Semantic Version Release
id: release
# Adjust tag with desired version if applicable.
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "[email protected]"

- name: Publish | Upload package to PyPI
uses: pypa/gh-action-pypi-publish@v1
if: steps.release.outputs.released == 'true'

- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/[email protected]
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
48 changes: 0 additions & 48 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 2ad36de

Please sign in to comment.