Skip to content

Commit

Permalink
change a bit the curl retry to support ubuntu 20.04 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
brokenpip3 authored Sep 25, 2024
1 parent 5932fdb commit 3b6fd9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test-local-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
fail-fast: false
matrix:
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
runs-on: ubuntu-latest
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest ]
runs-on: ${{ matrix.os }}
env:
BATS_LIB_PATH: "/usr/lib"
TERM: xterm
Expand Down Expand Up @@ -59,7 +60,8 @@ jobs:
fail-fast: false
matrix:
version: ["1.7.0", "1.8.2", "1.9.0", "1.10.0", "1.11.0", "latest"]
runs-on: ubuntu-latest
os: [ ubuntu-20.04, ubuntu-22.04, ubuntu-latest ]
runs-on: ${{ matrix.os }}
env:
BATS_LIB_PATH: "/usr/lib"
TERM: xterm
Expand Down
12 changes: 6 additions & 6 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ runs:
# From https://github.com/fluxcd/flux2/blob/44d69d6fc0c353e79c1bad021a4aca135033bce8/action/action.yml#L35
if [[ -z "$VERSION" ]] || [[ "$VERSION" = "latest" ]]; then
VERSION=$(curl -fsSL --retry 2 --retry-all-errors https://api.github.com/repos/bats-core/bats-core/releases/latest | grep tag_name | cut -d '"' -f 4)
VERSION=$(curl -fsSL --retry 4 --retry-connrefused https://api.github.com/repos/bats-core/bats-core/releases/latest | grep tag_name | cut -d '"' -f 4)
fi
[[ $VERSION = v* ]] && VERSION="${VERSION:1}"
mkdir -p ${TEMPDIR}
mkdir -p ${DESTDIR}
curl -sL --retry 2 --retry-all-errors ${URL}/archive/refs/tags/v${VERSION}.tar.gz | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
curl -sL --retry 4 --retry-connrefused ${URL}/archive/refs/tags/v${VERSION}.tar.gz | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
# Install
./install.sh ${DESTDIR}
Expand Down Expand Up @@ -170,7 +170,7 @@ runs:
mkdir -p ${TEMPDIR}
[[ "${DESTDIR}" == "$HOME"* ]] && CMD="" || CMD="sudo"
${CMD} mkdir -p ${DESTDIR}/src/
curl -sL --retry 2 --retry-all-errors ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
curl -sL --retry 4 --retry-connrefused ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
# Archlinux style, except that we are not in a fakeroot env
${CMD} install -Dm755 load.bash ${DESTDIR}/load.bash
for fn in src/*.bash; do
Expand Down Expand Up @@ -203,7 +203,7 @@ runs:
mkdir -p ${TEMPDIR}
[[ "${DESTDIR}" == "$HOME"* ]] && CMD="" || CMD="sudo"
${CMD} mkdir -p ${DESTDIR}/src/
curl -sL --retry 2 --retry-all-errors ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
curl -sL --retry 4 --retry-connrefused ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
# Archlinux style, except that we are not in a fakeroot env
${CMD} install -Dm755 load.bash ${DESTDIR}/load.bash
for fn in src/*.bash; do
Expand Down Expand Up @@ -236,7 +236,7 @@ runs:
mkdir -p ${TEMPDIR}
[[ "${DESTDIR}" == "$HOME"* ]] && CMD="" || CMD="sudo"
${CMD} mkdir -p ${DESTDIR}/src/
curl -sL --retry 2 --retry-all-errors ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
curl -sL --retry 4 --retry-connrefused ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
# Archlinux style, except that we are not in a fakeroot env so we need to use sudo
for fn in lib/*.bash; do
${CMD} install -Dm755 $fn \
Expand Down Expand Up @@ -268,7 +268,7 @@ runs:
mkdir -p ${TEMPDIR}
[[ "${DESTDIR}" == "$HOME"* ]] && CMD="" || CMD="sudo"
${CMD} mkdir -p ${DESTDIR}/src/
curl -sL --retry 2 --retry-all-errors ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
curl -sL --retry 4 --retry-connrefused ${url} | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
# Archlinux style, except that we are not in a fakeroot env
${CMD} install -Dm755 load.bash ${DESTDIR}/load.bash
for fn in src/*.bash; do
Expand Down

0 comments on commit 3b6fd9e

Please sign in to comment.