Skip to content

Commit

Permalink
fix(workflow): Use lefthook and mise
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Nov 30, 2024
1 parent 0d15b18 commit 3c03654
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- uses: arduino/setup-task@v2
- name: Build document
- uses: jdx/mise-action@v2
- name: 'Configure dependencies'
run: |
uv sync --frozen --all-extras
- name: 'Build document'
run: |
task setup docs:build
- name: Upload artifact
- name: 'Upload artifact'
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/mini18n-dirhtml
- name: Deploy to GitHub Pages
- name: 'Deploy to GitHub Pages'
id: deployment
uses: actions/deploy-pages@v4
31 changes: 16 additions & 15 deletions {{cookiecutter.project_basename}}/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- name: Lint by pre-commit
- uses: jdx/mise-action@v2
- name: 'Configure dependencies'
run: |
uv sync --frozen --all-extras
uvx pre-commit run --all-files
- name: 'Run linters'
run: |
lefthook run pre-commit --all-files
source-test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version:
{%- if cookiecutter.requires_python in ["3.9"] %}
Expand All @@ -43,13 +46,9 @@ jobs:
{%- endif %}
workspace: ['locked', 'latest']
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- uses: actions/checkout@v3
- uses: jdx/mise-action@v2
{%- raw %}
- uses: actions/setup-python@v5
id: 'setup-python'
with:
python-version: ${{ matrix.python-version }}
- name: 'Configure env as locked deps by uv.lock'
run: |
uv sync --frozen --python='${{ steps.setup-python.outputs.python-path }}'
Expand All @@ -62,21 +61,23 @@ jobs:
- name: 'Run tests'
run: |
uv run pytest
doc-test:
docs-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- uses: arduino/setup-task@v2
- name: Run tests
- uses: jdx/mise-action@v2
- name: 'Configure dependencies'
run: |
uv sync --frozen --all-extras
- name: 'Run tests'
run: |
task setup docs:build-linkcheck docs:build-dirhtml
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- name: Build package
- uses: jdx/mise-action@v2
- name: 'Try building as package'
run: |
uv build
ls -l dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- name: Build package
- uses: jdx/mise-action@v2
- name: 'Build package'
run: |
uv build
- uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 3c03654

Please sign in to comment.