--- name: Setup Environment description: Install uv, configure the system python, and the package dependencies inputs: uv-install-options: default: "" python-version: required: true cache-pre-commit: default: false cache-version: default: "v0.1" runs: using: composite steps: - name: Setup uv id: setup-uv uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0 with: enable-cache: true version-file: uv.lock python-version: ${{ inputs.python-version }} - name: Install Project Dependencies id: install-project-dependencies shell: bash run: | uv sync ${{ inputs.uv-install-options }} - name: Read pre-commit Version id: pre-commit-version if: inputs.cache-pre-commit == 'true' shell: bash run: >- echo "pre-commit-version=$(uv run pre-commit -V | awk '{print $2}')" >> $GITHUB_OUTPUT - name: pre-commit Cache id: pre-commit-cache if: inputs.cache-pre-commit == 'true' uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 with: path: ~/.cache/pre-commit/ key: cache-${{ inputs.cache-version }}-${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ steps.pre-commit-version.outputs.pre-commit-version }}-python-${{ inputs.python-version }}-${{ steps.setup-uv.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}