diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 5f3647e..3e399ec 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -19,7 +19,20 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 # v4 + - 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 }}' @@ -27,15 +40,13 @@ jobs: 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 + if: ${{ steps.cache-slide.outputs.cache-hit != 'true' || steps.cache-sdk.outputs.cache-hit != '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 @@ -56,8 +67,8 @@ jobs: benchmark-data-dir-path: '.' max-items-in-chart: 30 github-token: ${{ secrets.GITHUB_TOKEN }} - auto-push: true - alert-threshold: '200%' + auto-push: ${{ github.event_name == 'push' }} + alert-threshold: '120%' comment-on-alert: true fail-on-alert: true comment-always: true diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 02072cf..6b487fd 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -16,7 +16,20 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 # v4 + - 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 }}' @@ -24,15 +37,13 @@ jobs: 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 + if: ${{ steps.cache-slide.outputs.cache-hit != 'true' || steps.cache-sdk.outputs.cache-hit != '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 diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 8121830..1921f26 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -25,7 +25,20 @@ jobs: steps: - uses: actions/checkout@v4 # v4 + - 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 }}' @@ -33,23 +46,21 @@ jobs: 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 + if: ${{ steps.cache-slide.outputs.cache-hit != 'true' || steps.cache-sdk.outputs.cache-hit != '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 diff --git a/Makefile b/Makefile index 4c1236d..8623a41 100644 --- a/Makefile +++ b/Makefile @@ -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