Skip to content

chore(deps): pin dependencies #63

chore(deps): pin dependencies

chore(deps): pin dependencies #63

Workflow file for this run

---
name: test
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Generic
FORCE_COLOR: '1'
CLICOLOR: '1'
# Python
HATCH_VERBOSE: '1'
PYTEST_ADDOPTS: --color=yes
PYTHONUNBUFFERED: '1'
STABLE_PYTHON_VERSION: '3.13'
jobs:
complete:
name: Completion check
if: always()
permissions:
contents: none
runs-on: ubuntu-latest
needs:
- format
- lint
- typecheck
- test
- spelling
- pre-commit
steps:
- name: Failed
run: exit 1
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result,
'skipped')
format:
name: >-
Format Python
(${{ matrix.d == '.' && 'Core' || matrix.d == 'pypacter-api' && 'API' || 'Unknown' }})
on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, d: .}
- {os: ubuntu-latest, d: pypacter-api}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Set up uv
uses: astral-sh/setup-uv@e779db74266a80753577425b0f4ee823649f251d # v3.2.3
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
- name: Install Hatch
run: uv tool install hatch
- name: Format
run: hatch run format
working-directory: ${{ matrix.d }}
lint:
name: >-
Lint Python
(${{ matrix.d == '.' && 'Core' || matrix.d == 'pypacter-api' && 'API' || 'Unknown' }})
on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, d: .}
- {os: ubuntu-latest, d: pypacter-api}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Set up uv
uses: astral-sh/setup-uv@e779db74266a80753577425b0f4ee823649f251d # v3.2.3
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
- name: Install Hatch
run: uv tool install hatch
- name: Lint
run: hatch run lint
working-directory: ${{ matrix.d }}
typecheck:
name: >-
Typecheck Python
(${{ matrix.d == '.' && 'Core' || matrix.d == 'pypacter-api' && 'API' || 'Unknown' }})
on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, d: .}
- {os: ubuntu-latest, d: pypacter-api}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Set up uv
uses: astral-sh/setup-uv@e779db74266a80753577425b0f4ee823649f251d # v3.2.3
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
- name: Install Hatch
run: uv tool install hatch
- name: Typecheck
run: hatch run typecheck
working-directory: ${{ matrix.d }}
test:
name: >-
Test Python
(${{ matrix.d == '.' && 'Core' || matrix.d == 'pypacter-api' && 'API' || 'Unknown' }})
on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, d: .}
- {os: ubuntu-latest, d: pypacter-api}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-tags: true
- name: Set up uv
uses: astral-sh/setup-uv@e779db74266a80753577425b0f4ee823649f251d # v3.2.3
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
- name: Install Hatch
run: uv tool install hatch
- name: Test
run: hatch run test
working-directory: ${{ matrix.d }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || 'sk-000000000000000000000000000000000000000000000000' }}
spelling:
name: Spell check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Spell Check Repo
uses: crate-ci/typos@b74202f74b4346efdbce7801d187ec57b266bac8 # v1.27.3
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
env:
PRE_COMMIT_HOME: ${{ github.workspace }}/.pre-commit
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Cache PRE_COMMIT_HOME
- name: Cache pre-commit
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.2.2
with:
path: |
${{ env.PRE_COMMIT_HOME }}
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Run pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
committed:
name: Committed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: committed-action
uses: crate-ci/committed@608423fab72842b4be0be432ca0591337fc85698 # v1.1.1