diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bf0194a8..ca085554 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,9 +18,6 @@ concurrency: group: "pages" cancel-in-progress: true -env: - UV_CACHE_DIR: /tmp/.uv-cache - jobs: build: name: Build docs. @@ -31,18 +28,12 @@ jobs: uses: mozilla-actions/sccache-action@v0.0.6 - name: Set up uv - run: curl -LsSf https://astral.sh/uv/0.3.4/install.sh | sh - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Restore uv cache - uses: actions/cache@v4 + uses: astral-sh/setup-uv@v3 with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - restore-keys: | - uv-${{ runner.os }} + version: "0.4.18" + enable-cache: true + - name: Install Python + run: uv python install 3.10 - name: Build docs run: | @@ -53,9 +44,6 @@ jobs: with: path: ./docs/build/ - - name: Minimize uv cache - run: uv cache prune --ci - publish: name: Publish docs. environment: diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index e9ed2b9e..e2353f89 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -14,8 +14,6 @@ on: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" - # A constant location for the uv cache - UV_CACHE_DIR: /tmp/.uv-cache jobs: @@ -35,18 +33,12 @@ jobs: run: "sudo apt-get update && sudo apt-get install -y llvm-14" - name: Set up uv - run: curl -LsSf https://astral.sh/uv/0.3.4/install.sh | sh - - name: "Set up Python" - uses: actions/setup-python@v5 + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - restore-keys: | - uv-${{ runner.os }} + version: "0.4.18" + enable-cache: true + - name: Install Python + run: uv python install ${{ env.PYTHON_VERSION }} - name: Install Guppy run: uv sync @@ -76,9 +68,6 @@ jobs: - name: Rerun `py(...)` expression tests and pytket lowering with tket2 installed run: uv run pytest tests/integration/test_py.py tests/error/test_py_errors.py tests/integration/test_tket.py - - name: Minimize uv cache - run: uv cache prune --ci - test-coverage: name: Check Python (3.12) with coverage runs-on: ubuntu-latest @@ -93,18 +82,12 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Set up uv - run: curl -LsSf https://astral.sh/uv/0.3.4/install.sh | sh - - name: "Set up Python" - uses: actions/setup-python@v5 + uses: astral-sh/setup-uv@v3 with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - restore-keys: | - uv-${{ runner.os }} + version: "0.4.18" + enable-cache: true + - name: Install Python + run: uv python install ${{ env.PYTHON_VERSION }} - name: Install Guppy with execution and pytket run: uv sync --extra execution --extra pytket @@ -120,7 +103,4 @@ jobs: with: files: coverage.xml name: python - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Minimize uv cache - run: uv cache prune --ci \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file