Skip to content

Commit

Permalink
ci: cache sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
AzHicham committed Sep 10, 2024
1 parent cf1e0a0 commit 33e9c58
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 33 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,31 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4 # v4
- name: Google Storage authentication
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
export_environment_variables: true
create_credentials_file: true
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Cache sample slide
id: cache-slide
uses: actions/cache@v4
with:
path: tests/data/
key: slides-test
- name: Cache SDK
id: cache-sdk
uses: actions/cache@v4
with:
path: tmp/sdk/
key: cache-sdk
- name: Google Storage authentication
if: ${{ steps.cache-slide.outputs.cache-hit != 'true' && steps.cache-sdk.outputs.cache-hit != 'true' }}
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
export_environment_variables: true
create_credentials_file: true
- name: Download sample tests data
if: steps.cache-slide.outputs.cache-hit != 'true'
run: make dl-test-images
- name: Download dependencies
if: steps.cache-sdk.outputs.cache-hit != 'true'
run: make dl-sdk
- name: Install dependencies
run: make install-deps
- uses: dtolnay/rust-toolchain@stable
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,31 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4 # v4
- name: Google Storage authentication
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
export_environment_variables: true
create_credentials_file: true
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Cache sample slide
id: cache-slide
uses: actions/cache@v4
with:
path: tests/data/
key: slides-test
- name: Cache SDK
id: cache-sdk
uses: actions/cache@v4
with:
path: tmp/sdk/
key: cache-sdk
- name: Google Storage authentication
if: ${{ steps.cache-slide.outputs.cache-hit != 'true' && steps.cache-sdk.outputs.cache-hit != 'true' }}
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
export_environment_variables: true
create_credentials_file: true
- name: Download sample tests data
if: steps.cache-slide.outputs.cache-hit != 'true'
run: make dl-test-images
- name: Download dependencies
if: steps.cache-sdk.outputs.cache-hit != 'true'
run: make dl-sdk
- name: Install dependencies
run: make install-deps
- uses: dtolnay/rust-toolchain@stable
Expand Down
34 changes: 21 additions & 13 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,39 @@ jobs:

steps:
- uses: actions/checkout@v4 # v4
- name: Google Storage authentication
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
export_environment_variables: true
create_credentials_file: true
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Cache sample slide
id: cache-slide
uses: actions/cache@v4
with:
path: tests/data/
key: slides-test
- name: Cache SDK
id: cache-sdk
uses: actions/cache@v4
with:
path: tmp/sdk/
key: cache-sdk
- name: Google Storage authentication
if: ${{ steps.cache-slide.outputs.cache-hit != 'true' && steps.cache-sdk.outputs.cache-hit != 'true' }}
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
export_environment_variables: true
create_credentials_file: true
- name: Download sample tests data
if: steps.cache-slide.outputs.cache-hit != 'true'
run: make dl-test-images
- name: Download dependencies
if: steps.cache-sdk.outputs.cache-hit != 'true'
run: make dl-sdk
- name: Install dependencies
run: make install-deps
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.feature }}
- name: Install dependencies ubuntu
run: make install-deps
- name: Build & Test
run: cargo test --workspace ${{ matrix.feature }} -- --nocapture --test-threads=1

Expand Down
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
.PHONY: install-deps dl-test-images

dl-sdk:
cd /tmp && \
gsutil cp gs://az-philips/sdk.zip . && \
unzip sdk.zip -d .

install-deps:
export DEBIAN_FRONTEND=noninteractive && \
sudo apt-get update -qq && \
sudo apt-get install -y --no-install-recommends unzip binutils build-essential && \
cd /tmp && \
gsutil cp gs://az-philips/sdk.zip . && \
unzip sdk.zip -d . && \
cd ./sdk && \
cd /tmp/sdk && \
chmod +x InstallPathologySDK.sh && \
sudo ./InstallPathologySDK.sh -y

Expand Down

0 comments on commit 33e9c58

Please sign in to comment.