From 0202430fbaeac1d1335b37293dcd4ae50215ef3d Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Fri, 29 Mar 2024 17:36:53 +0400 Subject: [PATCH] Test Cirrus Runners Cache --- .github/workflows/cache-benchmark.yml | 78 +++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/cache-benchmark.yml diff --git a/.github/workflows/cache-benchmark.yml b/.github/workflows/cache-benchmark.yml new file mode 100644 index 0000000..bc47026 --- /dev/null +++ b/.github/workflows/cache-benchmark.yml @@ -0,0 +1,78 @@ +name: Cache Benchmark + +on: + push: + +env: + CACHE_BUSTER: 3 + +jobs: + actions-cache: + name: "${{ matrix.runs_on.name }} + actions/cache" + + strategy: + matrix: + runs_on: + - name: gh-ubuntu + image: "ubuntu-latest" + - name: cl-ubuntu-amd64 + image: "ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04-sm" + - name: cl-macos-arm64 + image: "ghcr.io/cirruslabs/macos-sonoma-xcode:latest" + + runs-on: ${{ matrix.runs_on.image }} + + steps: + - uses: actions/checkout@v4 + + - name: Print environment + run: env + + - name: Cache Binary + id: cache + uses: actions/cache@v4 + with: + path: testfile + key: "actions-cache-${{ matrix.runs_on.name }}-attempt-${{ env.CACHE_BUSTER }}" + + - name: Generate Binary + if: steps.cache.outputs.cache-hit != 'true' + run: dd if=/dev/urandom of=testfile bs=1024 count=512000 + + - name: Stat Binary + run: stat testfile + + cirruslabs-cache: + name: "${{ matrix.runs_on.name }} + cirruslabs/cache" + + strategy: + matrix: + runs_on: + - name: gh-ubuntu + image: "ubuntu-latest" + - name: cl-ubuntu-amd64 + image: "ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04-sm" + - name: cl-macos-arm64 + image: "ghcr.io/cirruslabs/macos-sonoma-xcode:latest" + + runs-on: ${{ matrix.runs_on.image }} + + steps: + - uses: actions/checkout@v4 + + - name: Print environment + run: env + + - name: Cache Binary + id: cache + uses: cirruslabs/cache@v4 + with: + path: testfile + key: "cirruslabs-cache-${{ matrix.runs_on.name }}-attempt-${{ env.CACHE_BUSTER }}" + + - name: Generate Binary + if: steps.cache.outputs.cache-hit != 'true' + run: dd if=/dev/urandom of=testfile bs=1024 count=512000 + + - name: Stat Binary + run: stat testfile