Skip to content

Commit

Permalink
Add caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed Dec 11, 2022
1 parent 05b8aed commit e8fc9e1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/python-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Install poetry
run: pip install poetry
- uses: actions/setup-python@v4
Expand All @@ -48,6 +50,25 @@ jobs:
cache: poetry
cache-dependency-path: |
./python/poetry.lock
- shell: pwsh
id: check_file_changed
run: |
$diff = git diff --name-only HEAD^ HEAD
$SourceDiff = $diff | Where-Object { $_ -match '^python/dev/Dockerfile$' }
$HasDiff = $SourceDiff.Length -gt 0
Write-Host "::set-output name=docs_changed::$HasDiff"
- name: Restore image
id: cache-docker
uses: actions/cache@v3
with:
path: ci/cache/docker/python
key: cache-docker-integration
- name: Update Image Cache if cache miss
if: steps.cache-docker.outputs.cache-hit != 'true' || steps.check_file_changed.outputs.docs_changed == 'True'
run: docker build -t python-integration && mkdir -p ci/cache/docker/python && docker image save python-integration --output ./ci/cache/docker/python/python-integration.tar
- name: Use Image Cache if cache hit
if: steps.cache-docker.outputs.cache-hit == 'true'
run: docker image load --input ./ci/cache/docker/python/python-integration.tar
- name: Install
working-directory: ./python
run: make install
Expand Down
1 change: 1 addition & 0 deletions python/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ version: "3"

services:
spark-iceberg:
image: python-integration
container_name: pyiceberg-spark
build: .
depends_on:
Expand Down

0 comments on commit e8fc9e1

Please sign in to comment.