77 - main
88
99jobs :
10- bash3-setup :
11- name : " Setup - Install Bash 3.0"
10+ build-bash30 :
11+ name : " Build Bash 3.0.22 "
1212 runs-on : ubuntu-latest
13- timeout-minutes : 10
13+ timeout-minutes : 20
1414 steps :
1515 - name : Checkout
1616 uses : actions/checkout@v4
1717 with :
1818 fetch-depth : 1
1919
20- - name : Cache Bash 3.0 Binary
20+ - name : Cache Bash 3.0.22 Build
2121 uses : actions/cache@v4
22- id : cache-bash3
22+ id : cache-bash
2323 with :
24- path : /opt /bash-3.0
25- key : bash-3.0.22-${{ runner.os }}
24+ path : /tmp /bash-3.0.22-build
25+ key : bash-3.0.22-build- ${{ runner.os }}
2626
27- - name : Install Bash 3.0
28- if : steps.cache-bash3 .outputs.cache-hit != 'true'
27+ - name : Download and Build Bash 3.0.22
28+ if : steps.cache-bash .outputs.cache-hit != 'true'
2929 run : |
30- # Update package lists
30+ mkdir -p /tmp/bash-3.0.22-build
31+ cd /tmp
32+
33+ # Install build dependencies
3134 sudo apt-get update
35+ sudo apt-get install -y build-essential wget curl
3236
33- # Install dependencies for building bash 3.0
34- sudo apt-get install -y \
35- build-essential \
36- curl \
37- git \
38- make
37+ # Download bash 3.0.22 from GNU FTP with retries
38+ BASH_VERSION="3.0.22"
39+ BASH_TARBALL="bash-${BASH_VERSION}.tar.gz"
40+ MAX_RETRIES=3
41+ RETRY_COUNT=0
3942
40- # Download and build bash 3.0.22
41- cd /tmp
42- curl -L https://ftp.gnu.org/gnu/bash/bash-3.0.22.tar.gz -o bash-3.0.22.tar.gz
43- tar xzf bash-3.0.22.tar.gz
44- cd bash-3.0.22
43+ while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
44+ echo "Attempt $((RETRY_COUNT+1))/$MAX_RETRIES: Downloading bash ${BASH_VERSION}..."
45+
46+ # Try different sources in order of reliability
47+ if wget --timeout=10 -O "${BASH_TARBALL}" \
48+ "https://ftpmirror.gnu.org/bash/${BASH_TARBALL}" 2>&1 | grep -v "^--"; then
49+ # Verify the download
50+ if tar -tzf "${BASH_TARBALL}" > /dev/null 2>&1; then
51+ echo "Successfully downloaded and verified bash ${BASH_VERSION}"
52+ break
53+ fi
54+ fi
55+
56+ RETRY_COUNT=$((RETRY_COUNT+1))
57+ if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
58+ echo "Download failed, retrying in 10 seconds..."
59+ sleep 10
60+ fi
61+ done
4562
46- # Configure and build
47- ./configure --prefix=/opt/bash-3.0
48- make
49- sudo make install
63+ # Check if we got a valid tarball
64+ if ! tar -tzf "${BASH_TARBALL}" > /dev/null 2>&1; then
65+ echo "Error: Failed to download valid bash ${BASH_VERSION} tarball"
66+ exit 1
67+ fi
5068
51- # Create symlink for easy access
52- sudo ln -sf /opt/bash-3.0/bin/bash /usr/local/bin/bash3
69+ # Extract and build
70+ tar xzf "${BASH_TARBALL}"
71+ cd "bash-${BASH_VERSION}"
5372
54- # Verify installation
55- /usr/local/bin/bash3 --version
73+ # Configure for minimal build
74+ ./configure \
75+ --prefix=/tmp/bash-3.0.22-build \
76+ --without-bash-malloc \
77+ --disable-nls
78+
79+ # Build
80+ make -j$(nproc)
81+
82+ # Install to cache directory
83+ make install
84+
85+ # Verify the build
86+ /tmp/bash-3.0.22-build/bin/bash --version
87+ echo "Bash 3.0.22 successfully built and cached"
5688
5789 bash3-tests :
58- name : " Bash 3.0 Tests - ${{ matrix.test_mode }}"
90+ name : " Bash 3.0.22 Tests - ${{ matrix.test_mode }}"
5991 runs-on : ubuntu-latest
6092 timeout-minutes : 15
61- needs : bash3-setup
93+ needs : build-bash30
6294 strategy :
6395 matrix :
6496 test_mode :
@@ -72,32 +104,34 @@ jobs:
72104 with :
73105 fetch-depth : 1
74106
75- - name : Restore Bash 3.0 from Cache
107+ - name : Restore Bash 3.0.22 Build from Cache
76108 uses : actions/cache@v4
77109 with :
78- path : /opt /bash-3.0
79- key : bash-3.0.22-${{ runner.os }}
110+ path : /tmp /bash-3.0.22-build
111+ key : bash-3.0.22-build- ${{ runner.os }}
80112
81- - name : Create Bash 3.0 Symlink
82- run : sudo ln -sf /opt/bash-3.0/bin/bash /usr/local/bin/bash3
113+ - name : Verify Bash 3.0.22
114+ run : |
115+ /tmp/bash-3.0.22-build/bin/bash --version
116+ echo "Using bash: $(/tmp/bash-3.0.22-build/bin/bash --version | head -1)"
83117
84118 - name : Run Tests - Standard Mode
85119 if : matrix.test_mode == 'standard'
86120 run : |
87- /usr/local /bin/bash3 ./bashunit tests/unit/ -q
121+ /tmp/bash-3.0.22-build /bin/bash ./bashunit tests/unit/ -q
88122 env :
89- BASH : /usr/local /bin/bash3
123+ BASH : /tmp/bash-3.0.22-build /bin/bash
90124
91125 - name : Run Tests - Simple Output Mode
92126 if : matrix.test_mode == 'simple'
93127 run : |
94- /usr/local /bin/bash3 ./bashunit --simple tests/unit/ -q
128+ /tmp/bash-3.0.22-build /bin/bash ./bashunit --simple tests/unit/ -q
95129 env :
96- BASH : /usr/local /bin/bash3
130+ BASH : /tmp/bash-3.0.22-build /bin/bash
97131
98132 - name : Run Tests - Parallel Mode
99133 if : matrix.test_mode == 'parallel'
100134 run : |
101- /usr/local /bin/bash3 ./bashunit --parallel tests/unit/ -q
135+ /tmp/bash-3.0.22-build /bin/bash ./bashunit --parallel tests/unit/ -q
102136 env :
103- BASH : /usr/local /bin/bash3
137+ BASH : /tmp/bash-3.0.22-build /bin/bash
0 commit comments