This commit is contained in:
Sami Samhuri 2026-01-02 13:27:12 -08:00
parent b29a1d5ff7
commit 4dbbc767a4
No known key found for this signature in database
2 changed files with 13 additions and 7 deletions

View file

@ -9,6 +9,8 @@ on:
jobs:
test:
runs-on: ubuntu-latest
env:
APT_CACHE_DIR: ${{ github.workspace }}/.cache/apt/archives
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
@ -21,15 +23,11 @@ jobs:
- name: Cache apt packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/test.yml') }}
path: .cache/apt
key: ${{ runner.os }}-apt-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Bootstrap
run: make bootstrap
- name: Prepare apt cache
run: |
sudo rm -f /var/cache/apt/archives/lock
sudo chmod -R a+rX /var/cache/apt/archives
- name: Run tests
run: make

View file

@ -2,7 +2,15 @@ default: c ruby
bootstrap:
@if command -v apt-get >/dev/null 2>&1; then \
sudo apt-get update && sudo apt-get install -y libreadline-dev; \
if [ -n "$$APT_CACHE_DIR" ]; then \
mkdir -p "$$APT_CACHE_DIR/partial"; \
sudo apt-get update && sudo apt-get install -y \
-o Dir::Cache::archives="$$APT_CACHE_DIR" \
-o Dir::Cache::archives::partial="$$APT_CACHE_DIR/partial" \
libreadline-dev; \
else \
sudo apt-get update && sudo apt-get install -y libreadline-dev; \
fi; \
elif command -v brew >/dev/null 2>&1; then \
brew list readline >/dev/null 2>&1 || brew install readline; \
else \