Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: utilize uv CI cache #2781

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/bleeding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ jobs:
run: .github/bin/bleeding ${{needs.bleeding.outputs.weblate_sha}} ${{needs.bleeding.outputs.weblate_date}}
- name: Configure Docker build
run: .github/bin/get-buildx-args
- name: Cache
uses: actions/cache@v3
id: cache
with:
path: uv-cache
key: uv-cache-${{ hashFiles('Dockerfile') }}-${{ matrix.architecture }}
- name: inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"uv-cache": "/.uv-cache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build the Docker image
run: .github/bin/docker-build

Expand Down Expand Up @@ -80,6 +94,20 @@ jobs:
run: .github/bin/bleeding ${{needs.bleeding.outputs.weblate_sha}} ${{needs.bleeding.outputs.weblate_date}}
- name: Configure Docker build
run: .github/bin/get-buildx-args
- name: Cache
uses: actions/cache@v3
id: cache
with:
path: uv-cache
key: uv-cache-${{ hashFiles('Dockerfile') }}-${{ matrix.architecture }}
- name: inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"uv-cache": "/.uv-cache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build the Docker image
run: .github/bin/docker-build

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ jobs:
version: v0.18.0
- name: Configure Docker build
run: .github/bin/get-buildx-args
- name: Cache
uses: actions/cache@v3
id: cache
with:
path: uv-cache
key: uv-cache-${{ hashFiles('Dockerfile') }}-${{ matrix.architecture }}
- name: inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"uv-cache": "/.uv-cache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build the Docker image
run: .github/bin/docker-build

Expand Down Expand Up @@ -62,6 +76,20 @@ jobs:
version: v0.18.0
- name: Configure Docker build
run: .github/bin/get-buildx-args
- name: Cache
uses: actions/cache@v3
id: cache
with:
path: uv-cache
key: uv-cache-${{ hashFiles('Dockerfile') }}-${{ matrix.architecture }}
- name: inject cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"uv-cache": "/.uv-cache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build the Docker image
run: .github/bin/docker-build

Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ COPY --link requirements.txt patches /app/src/

# Install dependencies
# hadolint ignore=DL3008,DL3013,SC2046,DL3003
RUN \
uv venv /app/venv \
RUN --mount=type=cache,target=/.uv-cache \
export UV_CACHE_DIR=/.uv-cache UV_LINK_MODE=copy \
&& uv venv /app/venv \
&& . /app/venv/bin/activate \
&& case "$WEBLATE_VERSION" in \
*+* ) \
uv pip install \
--no-cache-dir \
--compile-bytecode \
-r /app/src/requirements.txt \
"https://github.com/translate/translate/archive/master.zip" \
Expand All @@ -26,12 +26,12 @@ RUN \
;; \
* ) \
uv pip install \
--no-cache-dir \
--compile-bytecode \
-r /app/src/requirements.txt \
"Weblate[$WEBLATE_EXTRAS]==$WEBLATE_VERSION" \
;; \
esac
esac \
&& uv cache prune --ci
RUN /app/venv/bin/python -c 'from phply.phpparse import make_parser; make_parser()'
RUN ln -s /app/venv/share/weblate/examples/ /app/

Expand Down
Loading