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
1 change: 1 addition & 0 deletions .github/workflows/DOCS_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
MIKE_RELEASE_DOCs:
runs-on: ["ubuntu-latest"]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/PR_PREVIEW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ name: Deploy PR Pages Preview

on:
push:
branches:
- dev
branches-ignore:
- main
paths:
- "docs/**"
- mkdocs.yml
pull_request:
branches:
- dev
- main
paths:
- "docs/**"
Expand All @@ -23,6 +21,12 @@ on:

concurrency: preview-${{ github.ref }}

permissions:
contents: write
pull-requests: write
pages: write
id-token: write

jobs:
deploy-pr-preview:
runs-on: ["ubuntu-latest"]
Expand Down
55 changes: 40 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Build and Deploy Documentation
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read
Expand All @@ -19,19 +17,46 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --no-interaction
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Cache Poetry dependencies
id: cache-poetry
uses: actions/cache@v4
with:
path: .venv
key: venv-docs-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-docs-${{ runner.os }}-3.11-

- name: Cache MkDocs build
id: cache-mkdocs
uses: actions/cache@v4
with:
path: site
key: mkdocs-${{ runner.os }}-${{ hashFiles('**/*.md', 'mkdocs.yml') }}
restore-keys: |
mkdocs-${{ runner.os }}-

- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction

- name: Build documentation
run: |
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/pre-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Pre-commit Checks

on:
pull_request:
branches:
- dev
- main
types:
- opened
- edited
- synchronize
workflow_dispatch:
branches:
- dev
- main

permissions:
contents: read
pull-requests: write

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
pre-commit-checks:
name: Pre-commit Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Cache Poetry dependencies
id: cache-poetry
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-3.11-

- name: Cache pre-commit
id: cache-pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-${{ runner.os }}-

- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install project
run: poetry install --no-interaction

- name: Check Pull Request Title
uses: Slashgear/action-check-pr-title@main
with:
regexp: '(break|build|ci|docs|feat|fix|perf|refactor|style|test|ops|hotfix)\([a-z,A-Z,0-9,\-,\_,\/,:]+\)(:)\s{1}([\w\s]+)'

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
files: |
**/*.py
**/*.yml
**/*.yaml
**/*.toml
**/*.md

- name: Display changed files
run: |
echo "Changed files:"
echo "${{ steps.changed-files.outputs.all_changed_files }}"

- name: Run pre-commit
run: |
poetry run pre-commit run \
--verbose \
--show-diff-on-failure \
--all-files \
|| (echo "Pre-commit checks failed. Please run 'poetry run pre-commit run --all-files' locally to fix issues." && exit 1)

Loading
Loading