diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..bd61bb7 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: xwmx +custom: https://paypal.me/WilliamMelody diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..6e63da1 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,84 @@ +############################################################################### +# .github/workflows/tests.yml +# +# NOTE: GitHub Actions does not allocate a TTY, preventing detection of +# piped input using `[[ -t 0 ]]`. +# +# More information: +# +# https://github.com/actions/runner/issues/241 +# +# faketty is a GitHub action that uses work-arounds to provide a tty: +# +# https://github.com/marketplace/actions/faketty +# +# Scripts used by faketty for each platform: +# +# linux: `faketty` +# +# ```bash +# #!/bin/bash +# +# script -q -e -c "$*" +# ``` +# +# win32: `faketty.ps1` +# +# ```posh +# Invoke-Expression "$args" +# ``` +# +# darwin: `faketty` +# +# requires: `brew install expect` +# +# ```bash +# #!/bin/bash +# +# unbuffer $* +# ``` +############################################################################### + +name: "hosts ยท Test Suite" + +on: + pull_request: + branches: [ master ] + push: + branches: [ master ] + workflow_dispatch: + +jobs: + test-macos-11: + name: "Test: macOS Big Sur 11.0" + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v3 + - name: "Setup" + run: | + brew update + brew install bats-core + brew install expect + - name: "Set $TERM=xterm" + run: printf "TERM=xterm\\n" >> $GITHUB_ENV + - name: "Run bats tests" + run: unbuffer bats test + test-ubuntu-latest: + name: "Test: Ubuntu Latest" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: "Setup" + run: | + sudo apt-get update + sudo apt-get install bats -y + - name: "Install bats-core" + run: | + git clone https://github.com/bats-core/bats-core.git "${HOME}/bats-core" && + cd "${HOME}/bats-core" + git checkout 2e2e5df6adf0b846b411b6b2f7bb654cbc3e2c4e + sudo ./install.sh /usr/local + - name: "Set $TERM=xterm" + run: printf "TERM=xterm\\n" >> $GITHUB_ENV + - name: "Run bats tests" + run: script -q -e -c "bats test" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1c19bb5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -jobs: - include: - - os: linux - addons: - apt: - sources: - - sourceline: 'ppa:duggan/bats' - packages: - - bats - dist: bionic - language: minimal - - os: osx - before_install: - - brew install bats-core - osx_image: xcode11.3 - -script: bats test - diff --git a/README.md b/README.md index 2195416..1035c8c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/xwmx/hosts.svg?branch=master)](https://travis-ci.org/xwmx/hosts) +[![Build Status](https://img.shields.io/github/actions/workflow/status/xwmx/hosts/tests.yml?branch=master)](https://github.com/xwmx/hosts/actions) __ __ / /_ ____ _____/ /______