diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..54e007f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,74 @@ +name: Test + +on: + pull_request: + branches: [master] + push: + branches: [master] + +jobs: + test: + name: Test formulae + strategy: + fail-fast: false + matrix: + include: + # Gear macOS formulae + - os: macOS-latest + formula: gear + + - os: macOS-latest + formula: gear@0.1.6 + + - os: macOS-latest + formula: gear@0.1.5 + + - os: macOS-latest + formula: gear@0.1.4 + + - os: macOS-latest + formula: gear@0.1.3 + + - os: macOS-latest + formula: gear@0.1.2 + + - os: macOS-latest + formula: gear@0.1.1 + + # Vara macOS formulae + - os: macOS-latest + formula: vara + + - os: macOS-latest + formula: vara@1.1 + + - os: macOS-latest + formula: vara@1.0 + + runs-on: ${{ matrix.os }} + + steps: + # Not used but let's keep it for now + - name: Install brew on Linux + if: matrix.os == 'ubuntu-latest' + run: | + curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash + echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> $HOME/.bash_profile + (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> $HOME/.profile + brew install hello + + # TODO: Find a solution to test the tap from a PR's branch (#6) + - name: Add Gear tap from PR's branch + if: false # github.event_name == 'pull_request' # TODO: Uncomment after #6 + run: brew tap https://github.com/gear-tech/homebrew-gear/tree/${{ github.ref_name }} + + - name: Add Gear tap from master + if: true # github.event_name == 'push' # TODO: Uncomment after #6 + run: brew tap gear-tech/gear + + - name: Test formula + run: | + brew install ${{ matrix.formula }} + gear --version