diff --git a/.github/actions/setup-uv/action.yml b/.github/actions/setup-uv/action.yml new file mode 100644 index 000000000..a2dbe38bb --- /dev/null +++ b/.github/actions/setup-uv/action.yml @@ -0,0 +1,16 @@ +name: Setup uv +description: Setup uv for use in a workflow + +inputs: + python-version: + description: Python version to use. Falls back to .python-version if omitted. + required: false + +runs: + using: composite + steps: + - uses: astral-sh/setup-uv@v7 + with: + version: "0.11.19" + enable-cache: true + python-version: ${{ inputs.python-version }} diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index 76d5ccec4..c943ef06a 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -22,11 +22,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - version: "0.11.19" - enable-cache: true + - name: Setup uv + uses: ./.github/actions/setup-uv - name: Generate OpenAPI schema run: | make install-base @@ -42,11 +39,9 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive - - name: Install uv - uses: astral-sh/setup-uv@v7 + - name: Setup uv + uses: ./.github/actions/setup-uv with: - version: "0.11.19" - enable-cache: true python-version: ${{ matrix.python-version }} - name: Start pokeapi run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 758a5190c..75b4f4d21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,11 +27,8 @@ jobs: run: | docker compose cp db:/tmp/pokeapi.pgdump ./ ls -larth - - name: Install uv - uses: astral-sh/setup-uv@v7 - with: - version: "0.11.19" - enable-cache: true + - name: Setup uv + uses: ./.github/actions/setup-uv - name: Start pokeapi run: | rm -rf .venv