Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 32 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
version: [v0.31.5, v0.31.3, v0.30.0, v0.28.5]
version: [v0.31.3, v0.30.0, v0.28.5, latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand All @@ -71,13 +71,21 @@ jobs:
VERSION=$(buildcache --version)
echo "Installed version: $VERSION"
EXPECTED="${{ matrix.version }}"
# Remove 'v' prefix for comparison
EXPECTED_NUM="${EXPECTED#v}"
if [[ ! "$VERSION" =~ BuildCache.*version.*$EXPECTED_NUM ]]; then
echo "Error: Expected version $EXPECTED_NUM but got $VERSION"
exit 1
if [ "$EXPECTED" = "latest" ]; then
if [[ ! "$VERSION" =~ BuildCache.*version.*[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "Error: Expected a valid version but got $VERSION"
exit 1
fi
echo "✅ Latest version installed"
else
# Remove 'v' prefix for comparison
EXPECTED_NUM="${EXPECTED#v}"
if [[ ! "$VERSION" =~ BuildCache.*version.*$EXPECTED_NUM ]]; then
echo "Error: Expected version $EXPECTED_NUM but got $VERSION"
exit 1
fi
echo "✅ Correct version $EXPECTED installed"
fi
echo "✅ Correct version $EXPECTED installed"

test-invalid-version:
name: Test invalid version handling
Expand Down Expand Up @@ -204,25 +212,25 @@ jobs:
- name: Install second version (upgrade)
uses: ./
with:
version: v0.31.5
version: latest

- name: Verify upgrade
run: |
VERSION=$(buildcache --version)
if [[ ! "$VERSION" =~ BuildCache.*version.*0\.31\.5 ]]; then
echo "Error: Upgrade failed - expected 0.31.5 but got: $VERSION"
if [[ ! "$VERSION" =~ BuildCache.*version.*[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "Error: Upgrade to latest failed - invalid version: $VERSION"
exit 1
fi
echo "✅ Upgrade successful"
echo "✅ Upgrade to latest version successful"

test-url-formats:
name: Test different URL formats
runs-on: ubuntu-latest
strategy:
matrix:
include:
- version: v0.31.5
format: "new (v0.31.4+)"
- version: latest
format: "new (latest)"
- version: v0.31.4
format: "new (v0.31.4+)"
- version: v0.31.3
Expand All @@ -244,10 +252,17 @@ jobs:
run: |
VERSION=$(buildcache --version)
EXPECTED="${{ matrix.version }}"
EXPECTED_NUM="${EXPECTED#v}"
if [[ ! "$VERSION" =~ BuildCache.*version.*$EXPECTED_NUM ]]; then
echo "Error: Expected version $EXPECTED_NUM but got $VERSION"
exit 1
if [ "$EXPECTED" = "latest" ]; then
if [[ ! "$VERSION" =~ BuildCache.*version.*[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "Error: Expected a valid version but got $VERSION"
exit 1
fi
else
EXPECTED_NUM="${EXPECTED#v}"
if [[ ! "$VERSION" =~ BuildCache.*version.*$EXPECTED_NUM ]]; then
echo "Error: Expected version $EXPECTED_NUM but got $VERSION"
exit 1
fi
fi
echo "✅ ${{ matrix.version }} installed correctly using ${{ matrix.format }} URL format"

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ The action extracts buildcache to a version-specific directory in the user's hom
- Avoids requiring administrator privileges for binary installation
- Supports multiple buildcache versions simultaneously
- Keeps installations isolated and manageable
- Automatically installs required system dependencies (OpenSSL libraries on Linux)

## Using buildcache with CMake

Expand Down
12 changes: 0 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@ runs:
VERSION="${{ steps.version.outputs.version }}"
echo "Installing buildcache $VERSION for Linux..."

# Install required dependencies
echo "Installing required dependencies..."
sudo apt-get update -qq
# Install OpenSSL 1.1 libraries (buildcache requires libcrypto.so.1.1)
if ! sudo apt-get install -y libssl1.1; then
echo "libssl1.1 not available in default repos, adding focal repo for compatibility..."
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt-get update -qq
sudo apt-get install -y libssl1.1
fi

# Determine download URL based on version
# v0.31.4+ uses buildcache-linux-amd64.tar.gz
# v0.31.3 and earlier use buildcache-linux.tar.gz
Expand Down
10 changes: 5 additions & 5 deletions test-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fi

# Test 7: Check for version compatibility in tests
echo "📋 Test 7: Checking test version coverage..."
if grep -q "v0.31.5" .github/workflows/test.yml && \
if grep -q "v0.31.4" .github/workflows/test.yml && \
grep -q "v0.31.3" .github/workflows/test.yml && \
grep -q "v0.28.5" .github/workflows/test.yml; then
echo "✅ Test workflow covers multiple buildcache versions"
Expand Down Expand Up @@ -151,11 +151,11 @@ fi
# Test 10: Validate archive extraction and PATH logic
echo "📋 Test 10: Validating archive extraction and PATH logic..."

# Check Linux dependency installation
if grep -q "apt-get.*libssl" action.yml; then
echo "✅ Linux installs required dependencies"
# Check Linux does NOT install OpenSSL (no longer required)
if ! grep -q "apt-get.*libssl" action.yml; then
echo "✅ Linux does not install OpenSSL (no longer required)"
else
echo "❌ Linux dependency installation missing"
echo "❌ Linux still installs OpenSSL which is no longer required"
exit 1
fi

Expand Down
Loading