119 lines
3.5 KiB
YAML
119 lines
3.5 KiB
YAML
name: Bats test
|
|
on:
|
|
push:
|
|
paths:
|
|
- '.github/workflows/bats-test.yml'
|
|
- '*.sh'
|
|
- 'test/*.sh'
|
|
pull_request:
|
|
paths:
|
|
- '.github/workflows/bats-test.yml'
|
|
- '*.sh'
|
|
- 'test/*.sh'
|
|
|
|
jobs:
|
|
test-on-alpine:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: alpine:latest # Test on musl libc
|
|
steps:
|
|
- name: Install dependencies
|
|
run: apk add bash curl git openssl
|
|
- name: Bash version
|
|
run: bash --version
|
|
- name: CURL version
|
|
run: curl --version
|
|
- name: OpenSSL version
|
|
run: openssl version
|
|
- name: Check out code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Run test
|
|
env:
|
|
AliAccessKeyId: ${{ secrets.ALIACCESSKEYID }}
|
|
AliAccessKeySecret: ${{ secrets.ALIACCESSKEYSECRET }}
|
|
run: ./test/bats/bin/bats test/test.bats.sh
|
|
|
|
test-on-archlinux:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux:latest # Test on latest version of bash curl openssl
|
|
steps:
|
|
- name: Install dependencies
|
|
run: yes | pacman -Syu bash curl git openssl
|
|
- name: Bash version
|
|
run: bash --version
|
|
- name: CURL version
|
|
run: curl --version
|
|
- name: OpenSSL version
|
|
run: openssl version
|
|
- name: Check out code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Run test
|
|
env:
|
|
AliAccessKeyId: ${{ secrets.ALIACCESSKEYID }}
|
|
AliAccessKeySecret: ${{ secrets.ALIACCESSKEYSECRET }}
|
|
run: ./test/bats/bin/bats test/test.bats.sh
|
|
|
|
test-on-openwrt:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: openwrt/rootfs:x86-64-openwrt-22.03
|
|
steps:
|
|
- name: Fix var directory
|
|
run: mkdir -p /var/lock
|
|
- name: Install dependencies
|
|
run: |
|
|
opkg update
|
|
opkg install git git-http
|
|
opkg install bash curl openssl-util
|
|
# Bats dependencies
|
|
opkg install coreutils-nl
|
|
- name: Bash version
|
|
run: bash --version
|
|
- name: CURL version
|
|
run: curl --version
|
|
- name: OpenSSL version
|
|
run: openssl version
|
|
- name: Check out code
|
|
if: ${{ github.event.act }}
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Check out code (with git)
|
|
if: ${{ !github.event.act }}
|
|
run: git clone --depth 1 --recurse-submodules https://github.com/${{ github.repository }}.git /tmp/${{ github.sha }}
|
|
- name: Run test
|
|
env:
|
|
AliAccessKeyId: ${{ secrets.ALIACCESSKEYID }}
|
|
AliAccessKeySecret: ${{ secrets.ALIACCESSKEYSECRET }}
|
|
run: |
|
|
[[ -d /tmp/${{ github.sha }} ]] && cd /tmp/${{ github.sha }}
|
|
./test/bats/bin/bats test/test.bats.sh
|
|
|
|
test-on-ubuntu-20_04:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Update package
|
|
run: sudo apt update -y && sudo apt upgrade -y
|
|
- name: Install dependencies
|
|
run: sudo apt install -y bash curl git openssl
|
|
- name: Bash version
|
|
run: bash --version
|
|
- name: CURL version
|
|
run: curl --version
|
|
- name: OpenSSL version
|
|
run: openssl version
|
|
- name: Check out code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Run test
|
|
env:
|
|
AliAccessKeyId: ${{ secrets.ALIACCESSKEYID }}
|
|
AliAccessKeySecret: ${{ secrets.ALIACCESSKEYSECRET }}
|
|
run: ./test/bats/bin/bats test/test.bats.sh
|