Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
build:
name: Build Package
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Setup Python
uses: actions/setup-python@v5.0.0
with:
python-version: 3.11

- name: Setup Poetry
uses: threeal/setup-poetry-action@v1.0.0

- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3.3.2
with:
path: .venv
key: poetry-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}

- name: Install Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: poetry install --with dev

- name: Check Format
run: poetry run poe format && git diff --exit-code HEAD

- name: Check Lint
run: poetry run poe lint

- name: Test Package
run: poetry run poe test

- name: Generate Documentation
run: poetry run poe docs
68 changes: 23 additions & 45 deletions .github/workflows/ci.yaml → .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
name: CI
name: Deploy
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
deploy-pages:
name: Deploy Pages
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy-pages.outputs.page_url }}
concurrency:
group: pages
cancel-in-progress: false
steps:
- name: Setup Pages
uses: actions/configure-pages@v4.0.0

- name: Checkout
uses: actions/checkout@v4.1.1

Expand All @@ -24,54 +31,25 @@ jobs:
- name: Setup Poetry
uses: threeal/setup-poetry-action@v1.0.0

- name: Cache deps
id: cache_deps
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3.3.2
with:
path: .venv
key: poetry-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}

- name: Install deps
if: steps.cache_deps.outputs.cache-hit != 'true'
- name: Install Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: poetry install --with dev

- name: Check format
run: poetry run poe format && git diff --exit-code HEAD

- name: Check lint
run: poetry run poe lint

- name: Run testing
run: poetry run poe test

- name: Generate docs
- name: Generate Documentation
run: poetry run poe docs

- name: Upload docs artifact
if: ${{ matrix.os }} == 'ubuntu'
- name: Upload Documentation
uses: actions/upload-pages-artifact@v3.0.0
with:
path: docs

deploy:
name: Deploy
if: github.event_name != 'pull_request' && github.ref_name == 'main'
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: pages
cancel-in-progress: false
steps:
- name: Setup Pages
uses: actions/configure-pages@v4.0.0

- name: Deploy Pages
id: deployment
id: deploy-pages
uses: actions/deploy-pages@v4.0.2
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[![version](https://img.shields.io/github/v/release/threeal/python-starter?style=flat-square)](https://github.com/threeal/python-starter/releases)
[![license](https://img.shields.io/github/license/threeal/python-starter?style=flat-square)](./LICENSE)
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/python-starter/ci.yaml?branch=main&style=flat-square)](https://github.com/threeal/python-starter/actions/workflows/ci.yaml)
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/python-starter/build.yaml?branch=main&style=flat-square)](https://github.com/threeal/python-starter/actions/workflows/build.yaml)
[![deploy status](https://img.shields.io/github/actions/workflow/status/threeal/python-starter/deploy.yaml?branch=main&label=deploy&style=flat-square)](https://github.com/threeal/python-starter/actions/workflows/deploy.yaml)

The Python Starter is a [GitHub repository template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) that provides a minimalistic boilerplate to kickstart your [Python](https://www.python.org/) project. This template offers a streamlined foundation, complete with predefined file structures, essential tools, and recommended settings, ensuring a swift and efficient start to your Python development journey.

Expand Down