Run CI jobs #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Run CI jobs' | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 * * 5' # 18:00 on Friday JST | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jdx/mise-action@v2 | |
- name: 'Configure dependencies' | |
run: | | |
uv sync --frozen --all-extras | |
- name: 'Run linters' | |
run: | | |
lefthook run pre-commit --all-files | |
source-test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
- '3.13' | |
workspace: ['locked', 'latest'] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: jdx/mise-action@v2 | |
- name: 'Setup python' | |
id: 'setup-python' | |
run: | | |
uv python install ${{ matrix.python-version }} | |
python_path=`uv python find ${{ matrix.python-version }}` | |
echo "python-path=$python_path" >> $GITHUB_OUTPUT | |
- name: 'Configure env as locked deps by uv.lock' | |
run: | | |
uv sync --frozen --python='${{ steps.setup-python.outputs.python-path }}' | |
if: ${{ matrix.workspace == 'locked'}} | |
- name: 'Configure env as latest deps on PyPI' | |
run: | | |
uv sync -U --python='${{ steps.setup-python.outputs.python-path }}' | |
if: ${{ matrix.workspace == 'latest'}} | |
- name: 'Run tests' | |
run: | | |
uv run pytest | |
docs-test: | |
runs-on: '${{ matrix.runner }}' | |
strategy: | |
max-parallel: 4 | |
matrix: | |
runner: | |
- 'ubuntu-latest' | |
- 'windows-latest' | |
- 'macos-latest' | |
- 'macos-13' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jdx/mise-action@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Configure dependencies' | |
run: | | |
echo '3.11' > .python-version | |
uv sync --frozen --all-extras | |
cd docs | |
pnpm install | |
- name: 'Run tests' | |
run: | | |
task setup docs:build-linkcheck docs:build-dirhtml | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jdx/mise-action@v2 | |
- name: 'Try building as package' | |
run: | | |
uv build | |
ls -l dist |