-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-github-actions.sh
More file actions
executable file
Β·52 lines (43 loc) Β· 1.8 KB
/
test-github-actions.sh
File metadata and controls
executable file
Β·52 lines (43 loc) Β· 1.8 KB
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
#!/bin/bash
set -exo pipefail
# Test script to simulate GitHub Actions workflow locally
# This helps verify the workflow before pushing to GitHub
echo "π§ͺ Testing GitHub Actions workflow simulation..."
# Test 1: Matrix configuration
echo "π Testing matrix configuration..."
MATRIX=$(jq -c . < ./distro_versions.json)
echo "Matrix: $MATRIX"
# Test 2: Generate Dockerfiles for all versions
echo "π¨ Generating Dockerfiles for all versions..."
./crypt-keeper.sh generate all
# Test 3: Test multi-architecture build command (without actual build)
echo "π³ Testing multi-architecture build command..."
# Use the actual matrix from distro_versions.json
jq -r '.include[] | "\(.os) \(.version)"' ./distro_versions.json | while read -r os version; do
echo "Testing $os-$version..."
MAIN_TAG=$(./crypt-keeper.sh docker-image-name "$os" "$version")
DIST_TAG=$(./crypt-keeper.sh docker-image-dist-tag "$os" "$version")
ALT_TAG=$(./crypt-keeper.sh docker-image-alt-name "$os" "$version")
echo " Main tag: $MAIN_TAG"
echo " Dist tag: $DIST_TAG"
echo " Alt tag: $ALT_TAG"
# Check if Dockerfile exists
if [ -f "$os/$version/Dockerfile" ]; then
echo " β
Dockerfile exists"
else
echo " β Dockerfile missing"
exit 1
fi
done
# Test 4: Test local build (optional - requires Docker)
if [ "${1:-}" = "--build" ]; then
echo "π¨ Testing local build for ubuntu-noble..."
docker build --tag debbuilder:ubuntu-noble ubuntu/noble
echo "β
Local build successful"
fi
echo "π All tests passed! GitHub Actions workflow is ready."
echo ""
echo "π Next steps:"
echo "1. Commit and push to GitHub"
echo "2. Set up DOCKER_USER and DOCKER_PASS secrets in repository settings"
echo "3. GitHub Actions will automatically build multi-architecture images"