add test for ubuntu-latest #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@v4 | |
| 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 --noconfirm 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@v4 | |
| 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-24.10 | |
| 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@v4 | |
| 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: | |
| runs-on: ubuntu-latest | |
| 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@v4 | |
| with: | |
| submodules: true | |
| - name: Run test | |
| env: | |
| AliAccessKeyId: ${{ secrets.ALIACCESSKEYID }} | |
| AliAccessKeySecret: ${{ secrets.ALIACCESSKEYSECRET }} | |
| run: ./test/bats/bin/bats test/test.bats.sh |