Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Apr 12, 2024
1 parent 0d559d7 commit b7d0c46
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish to PyPi @ Release

on:
release:
types: [published]

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build source and wheels
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Upload to PyPi
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/Starlette-Plus
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
42 changes: 42 additions & 0 deletions .github/workflows/lint_and_coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Type Coverage and Linting

on:
push:
branches:
- main

jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.x"]

name: "Type Coverage and Linting @ ${{ matrix.python-version }}"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Setup Python @ ${{ matrix.python-version }}"
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
cache: "pip"

- name: "Install Python deps @ ${{ matrix.python-version }}"
id: install-deps
run: |
pip install -Ur requirements.txt
- name: "Run Pyright @ ${{ matrix.python-version }}"
uses: jakebailey/pyright-action@v1
with:
no-comments: ${{ matrix.python-version != '3.x' }}
warnings: false

- name: Lint with Ruff
if: ${{ always() && steps.install-deps.outcome == 'success' }}
uses: chartboost/ruff-action@v1
15 changes: 15 additions & 0 deletions .github/workflows/signoff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: validate-signoff
on:
pull_request:
types:
- opened
- edited

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: PR Description Check
uses: pythonistaguild/[email protected]
with:
content: "[x] I have read and agree to the [Developer Certificate of Origin]"

0 comments on commit b7d0c46

Please sign in to comment.