-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (50 loc) · 1.66 KB
/
cache-benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Cache Benchmark
on:
push:
env:
CACHE_BUSTER: 6
NUM_OF_1K_BLOCKS: 2560000
jobs:
actions-cache:
name: "${{ matrix.runs_on.name }} + actions/cache"
strategy:
matrix:
runs_on:
- name: gh-ubuntu
image: "ubuntu-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=${{ env.NUM_OF_1K_BLOCKS }}
- name: Stat Binary
run: stat testfile
cirruslabs-cache:
name: "${{ matrix.runs_on.name }} + cURL"
strategy:
matrix:
runs_on:
- 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: Generate Binary
run: dd if=/dev/urandom of=testfile bs=1024 count=${{ env.NUM_OF_1K_BLOCKS }}
- name: Upload Binary
run: curl -v --data-binary testfile "http://$CIRRUS_HTTP_CACHE_HOST/binary-${{ env.CACHE_BUSTER }}"
- name: Download binary
run: curl -v -o downloaded-binary.bin "http://$CIRRUS_HTTP_CACHE_HOST/binary-${{ env.CACHE_BUSTER }}" || true