Skip to content

HTTP cache via wget #27

HTTP cache via wget

HTTP cache via wget #27

name: Cache Benchmark
on:
push:
env:
CACHE_BUSTER: "${{ github.run_id }}-${{ github.run_attempt }}"
NUM_OF_1K_BLOCKS: 2560000
jobs:
http-cache:
name: "${{ matrix.runs_on.name }} + HTTP cache via wget"
strategy:
matrix:
runs_on:
- name: github-ubuntu-amd64
image: "ubuntu-latest"
- name: cirrus-ubuntu-amd64
image: "ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04-sm"
- name: cirrus-ubuntu-arm64
image: "ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04-sm"
- name: cirrus-macos-arm64
image: "ghcr.io/cirruslabs/macos-sonoma-xcode:latest"
runs-on: ${{ matrix.runs_on.image }}
steps:
- name: Generate Binary
run: dd if=/dev/urandom of=testfile bs=1024 count=${{ env.NUM_OF_1K_BLOCKS }}
- name: Cache Binary
run: wget --quiet --method POST --body-file testfile "http://$CIRRUS_HTTP_CACHE_HOST/binary-${{ matrix.runs_on.name }}-${{ env.CACHE_BUSTER }}"
- name: Remove binary to save space
run: rm binary.bin
- name: Restore Binary
run: wget --quiet -O testfile-restored "http://$CIRRUS_HTTP_CACHE_HOST/binary-${{ matrix.runs_on.name }}-${{ env.CACHE_BUSTER }}"