diff --git a/.github/workflows/test.sh b/.github/workflows/test.sh new file mode 100644 index 0000000..957bab6 --- /dev/null +++ b/.github/workflows/test.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -e + +tmpdir=$(mktemp -d) + +export OSH="$tmpdir/path with space" +export HOME="$tmpdir/home with space" +mkdir -p "$HOME" + +OSH_REPOSITORY="$PWD" ./tools/install.sh + +source "$HOME/.bashrc" + +set | grep -aE "^OSH" + +if [[ "$OSH_THEME" == "font" ]]; then + echo "Installation succeeded" +else + echo "Installation failed, \$OSH_THEME is not set to 'font'" + exit 1 +fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3648307 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + # ubuntu-20.04 available: https://github.com/actions/virtual-environments/issues/1816 + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + submodules: false + - name: Upgrade bash on Mac + if: runner.os == 'macOs' + run: brew install bash + - name: Install oh-my-bash + shell: bash + run: bash --noprofile --norc -i "$PWD/.github/workflows/test.sh"