add test on Alpine and Nanoserver using busybox (#265)

* alpine and nanoserver tests

* revert custom tools

* try remove prepare steps

* revert install pbzip2

Co-authored-by: Решетников Александр (Reshetnikov_AS) <Reshetnikov_AS@directum.ru>
This commit is contained in:
Alexandr Reshetnikov
2022-02-07 14:21:20 +04:00
committed by GitHub
parent 5809be74e1
commit 64674c7416
3 changed files with 91 additions and 29 deletions

View File

@@ -10,7 +10,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Install Linux packages
- name: Install Ubuntu packages
if: runner.os == 'Linux'
run: sudo env DEBIAN_FRONTEND=noninteractive apt-get -qq -y install pbzip2 zstd
@@ -20,14 +20,13 @@ jobs:
- name: Checkout Makeself
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Build release
run: |
git submodule update --init --recursive
make
run: make
- name: Upload build artifact
uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v1
with:
name: Makeself-Build-${{ runner.os }}
path: release
@@ -35,27 +34,34 @@ jobs:
- name: Run tests
run: make test
test-make-alpine:
runs-on: ubuntu-latest
container: alpine:latest
steps:
- name: install deps
run: apk add --no-cache bash git make libarchive-tools gnupg coreutils
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Run tests
run: make test
test-freebsd:
needs: test
runs-on: macos-10.15
name: Test Makeself on FreeBSD
steps:
- name: Checkout Makeself
uses: actions/checkout@v2
- name: Install git submodules
run: git submodule update --init --recursive
- name: Download Linux-built artifact
uses: actions/download-artifact@v2
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-Linux
path: linux
- name: Download Mac-built artifact
uses: actions/download-artifact@v2
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-macOS
path: mac
- name: Download Windows-built artifact
uses: actions/download-artifact@v2
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-Windows
path: windows
@@ -63,7 +69,7 @@ jobs:
uses: vmactions/freebsd-vm@v0.1.5
with:
usesh: true
prepare: pkg install -y pbzip2 bash
prepare: pkg install -y pbzip2
run: |
pwd; freebsd-version
sh ./linux/makeself*.run --target /tmp/makeself-linux
@@ -75,22 +81,15 @@ jobs:
runs-on: macos-10.15
name: Test Makeself on Solaris
steps:
- name: Checkout Makeself
uses: actions/checkout@v2
- name: Install git submodules
run: git submodule update --init --recursive
- name: Download Linux-built artifact
uses: actions/download-artifact@v2
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-Linux
path: linux
- name: Download Mac-built artifact
uses: actions/download-artifact@v2
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-macOS
path: mac
- name: Download Windows-built artifact
uses: actions/download-artifact@v2
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-Windows
path: windows
@@ -105,6 +104,65 @@ jobs:
sh ./mac/makeself*.run --target /tmp/makeself-mac
sh ./windows/makeself*.run --target /tmp/makeself-windows
test-alpine:
needs: test
name: Test Makeself on Alpine
runs-on: ubuntu-latest
container: alpine:latest
steps:
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-Linux
path: linux
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-macOS
path: mac
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-Windows
path: windows
- name: Test on Alpine
run: |
sh ./linux/makeself*.run --target /tmp/makeself-linux
sh ./mac/makeself*.run --target /tmp/makeself-mac
sh ./windows/makeself*.run --target /tmp/makeself-windows
test-nanoserver:
needs: test
name: Test Makeself on Nanoserver
runs-on: windows-2022
env:
IMAGE_NAME: mcr.microsoft.com/windows/nanoserver:ltsc2022-amd64
steps:
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-Linux
path: linux
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-macOS
path: mac
- uses: actions/download-artifact@v2
with:
name: Makeself-Build-Windows
path: windows
- name: pull windows container ${{ env.IMAGE_NAME }}
shell: cmd
run: |
docker pull ${{ env.IMAGE_NAME }}
docker images ${{ env.IMAGE_NAME }}
- name: Test on Nanoserver
shell: cmd
run: >
docker container run --rm --env CI=true -v ${{ github.workspace }}:C:\app -w C:\app ${{ env.IMAGE_NAME }}
curl --fail --silent --show-error --remote-name --location "https://frippery.org/files/busybox/busybox64.exe" &&
busybox64 sh .\linux\makeself*.run --target \tmp\makeself-linux &&
busybox64 sh .\mac\makeself*.run --target \tmp\makeself-mac &&
busybox64 sh .\windows\makeself*.run --target \tmp\makeself-windows
lint:
runs-on: ubuntu-latest

View File

@@ -652,6 +652,7 @@ fi
# See if we have GNU tar
TAR=`exec <&- 2>&-; which gtar || command -v gtar || type gtar`
test -x "$TAR" || TAR=`exec <&- 2>&-; which bsdtar || command -v bsdtar || type bsdtar`
test -x "$TAR" || TAR=tar
tmparch="${TMPDIR:-/tmp}/mkself$$.tar"

View File

@@ -1,8 +1,11 @@
#!/bin/sh
# Run every available test - Bash needed
cd test
THISDIR="$(realpath "$(dirname "$0")")"
cd "$THISDIR/test"
for test in *test;
do
echo "Running test $test ..."
bash $test || { echo "*** ERROR: Test '$test' failed!"; exit 1; }
bash "$test" || { echo "*** ERROR: Test '$test' failed!"; exit 1; }
done