Skip to content

Commit

Permalink
Replace use of bintray with the cache action
Browse files Browse the repository at this point in the history
Instead of fetching Kyua from bintray, which does not work anymore,
rely on GitHub's Actions cache action.
  • Loading branch information
jmmv committed Oct 7, 2023
1 parent 62c64ce commit 10fc9d0
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 33 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

set -e -x

readonly PREFIX="${1:-${HOME}/local}"

if [ -d /usr/local/share/aclocal ]; then
autoreconf -isv -I/usr/local/share/aclocal
else
Expand All @@ -43,6 +45,6 @@ fi
./configure SHTK_SHELL="${shell_path}"

f=
f="${f} PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'"
f="${f} PKG_CONFIG_PATH='${PREFIX}/lib/pkgconfig'"
f="${f} SHTK_SHELL='${shell_path}'"
make distcheck DISTCHECK_CONFIGURE_FLAGS="${f}"
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@

set -e -x

sudo apt-get update -qq
sudo apt-get install -y liblua5.2-0 liblua5.2-dev \
libsqlite3-0 libsqlite3-dev pkg-config sqlite3 \
${EXTRA_PACKAGES} ${SHELL_NAME}
readonly PREFIX="${1:-${HOME}/local}"

install_prereqs() {
sudo apt-get update -qq
sudo apt-get install -y liblua5.2-0 liblua5.2-dev \
libsqlite3-0 libsqlite3-dev pkg-config sqlite3 \
${EXTRA_PACKAGES} ${SHELL_NAME}
}

install_from_github() {
local name="${1}"; shift
Expand All @@ -48,26 +52,21 @@ install_from_github() {
cd "${distname}"
./configure \
--disable-developer \
--prefix="${PREFIX}" \
--without-atf \
--without-doxygen \
CPPFLAGS="-I/usr/local/include" \
LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" \
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
CPPFLAGS="-I${PREFIX}/include" \
LDFLAGS="-L${PREFIX}/lib -Wl,-R/usr/local/lib" \
PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
make
sudo make install
make install
cd -

rm -rf "${distname}" "${distname}.tar.gz"
}

install_from_bintray() {
local name="20160204-usr-local-kyua-ubuntu-12-04-amd64-${CC:-gcc}.tar.gz"
wget "http://dl.bintray.com/jmmv/kyua/${name}" || return 1
sudo tar -xzvp -C / -f "${name}"
rm -f "${name}"
}

if ! install_from_bintray; then
if [ ! -e "${PREFIX}/bin/kyua" ]; then
install_prereqs
install_from_github atf 0.21
install_from_github lutok 0.4
install_from_github kyua 0.12
Expand Down
64 changes: 48 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ jobs:
SHELL_NAME: bash
steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/install-deps.sh
- run: ./.github/workflows/build.sh
- uses: actions/cache@v2
with:
path: ~/kyua
key: kyua-${{ runner.os }}-${{ hashFiles('.github/workflows/install-kyua.sh') }}
- run: ./.github/workflows/install-kyua.sh ~/kyua
- run: ./.github/workflows/build.sh ~/kyua

bash-cvs:
runs-on: ubuntu-latest
Expand All @@ -20,8 +24,12 @@ jobs:
SHELL_NAME: bash
steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/install-deps.sh
- run: ./.github/workflows/build.sh
- uses: actions/cache@v2
with:
path: ~/kyua
key: kyua-${{ runner.os }}-${{ hashFiles('.github/workflows/install-kyua.sh') }}
- run: ./.github/workflows/install-kyua.sh ~/kyua
- run: ./.github/workflows/build.sh ~/kyua

dash-nothing:
runs-on: ubuntu-latest
Expand All @@ -30,8 +38,12 @@ jobs:
SHELL_NAME: dash
steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/install-deps.sh
- run: ./.github/workflows/build.sh
- uses: actions/cache@v2
with:
path: ~/kyua
key: kyua-${{ runner.os }}-${{ hashFiles('.github/workflows/install-kyua.sh') }}
- run: ./.github/workflows/install-kyua.sh ~/kyua
- run: ./.github/workflows/build.sh ~/kyua

dash-cvs:
runs-on: ubuntu-latest
Expand All @@ -40,8 +52,12 @@ jobs:
SHELL_NAME: dash
steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/install-deps.sh
- run: ./.github/workflows/build.sh
- uses: actions/cache@v2
with:
path: ~/kyua
key: kyua-${{ runner.os }}-${{ hashFiles('.github/workflows/install-kyua.sh') }}
- run: ./.github/workflows/install-kyua.sh ~/kyua
- run: ./.github/workflows/build.sh ~/kyua

mksh-nothing:
runs-on: ubuntu-latest
Expand All @@ -50,8 +66,12 @@ jobs:
SHELL_NAME: mksh
steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/install-deps.sh
- run: ./.github/workflows/build.sh
- uses: actions/cache@v2
with:
path: ~/kyua
key: kyua-${{ runner.os }}-${{ hashFiles('.github/workflows/install-kyua.sh') }}
- run: ./.github/workflows/install-kyua.sh ~/kyua
- run: ./.github/workflows/build.sh ~/kyua

mksh-cvs:
runs-on: ubuntu-latest
Expand All @@ -60,8 +80,12 @@ jobs:
SHELL_NAME: mksh
steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/install-deps.sh
- run: ./.github/workflows/build.sh
- uses: actions/cache@v2
with:
path: ~/kyua
key: kyua-${{ runner.os }}-${{ hashFiles('.github/workflows/install-kyua.sh') }}
- run: ./.github/workflows/install-kyua.sh ~/kyua
- run: ./.github/workflows/build.sh ~/kyua

zsh-nothing:
runs-on: ubuntu-latest
Expand All @@ -70,8 +94,12 @@ jobs:
SHELL_NAME: zsh
steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/install-deps.sh
- run: ./.github/workflows/build.sh
- uses: actions/cache@v2
with:
path: ~/kyua
key: kyua-${{ runner.os }}-${{ hashFiles('.github/workflows/install-kyua.sh') }}
- run: ./.github/workflows/install-kyua.sh ~/kyua
- run: ./.github/workflows/build.sh ~/kyua

zsh-cvs:
runs-on: ubuntu-latest
Expand All @@ -80,5 +108,9 @@ jobs:
SHELL_NAME: zsh
steps:
- uses: actions/checkout@v2
- run: ./.github/workflows/install-deps.sh
- run: ./.github/workflows/build.sh
- uses: actions/cache@v2
with:
path: ~/kyua
key: kyua-${{ runner.os }}-${{ hashFiles('.github/workflows/install-kyua.sh') }}
- run: ./.github/workflows/install-kyua.sh ~/kyua
- run: ./.github/workflows/build.sh ~/kyua

0 comments on commit 10fc9d0

Please sign in to comment.