Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workflow for testing formulae #5

Merged
merged 18 commits into from
Jun 16, 2023
110 changes: 110 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Test

on:
pull_request:
branches: [master]
push:
branches: [master]
schedule:
- cron: '0 0 * * *'
shamilsan marked this conversation as resolved.
Show resolved Hide resolved

env:
GEAR_VERSIONS: 0.1.6 0.1.5 0.1.4 0.1.3 0.1.2 0.1.1
VARA_VERSIONS: 1.1 1.0

jobs:
test:
name: Test formulae
strategy:
fail-fast: false
matrix:
include:
# Gear Linux formulae
- os: ubuntu-latest
unimplemented: true # TODO: Remove after adding support for Linux
formula: gear

# Vara Linux formulae
- os: ubuntu-latest
unimplemented: true # TODO: Remove after adding support for Linux
formula: vara

# Gear macOS formulae
- os: macOS-latest
unimplemented: false # TODO: Remove after adding support for Linux
formula: gear
version: 0.1.6-92ca3911de2

- os: macOS-latest
unimplemented: false
formula: [email protected]
version: 0.1.6-92ca3911de2

- os: macOS-latest
unimplemented: false
formula: [email protected]
version: 0.1.4-696abd96d43

- os: macOS-latest
unimplemented: false
formula: [email protected]
version: 0.1.4-26eb1b4f84d

- os: macOS-latest
unimplemented: false
formula: [email protected]
version: 0.1.3-e42c79acee5

- os: macOS-latest
unimplemented: false
formula: [email protected]
version: 0.1.2-ea26723f253

- os: macOS-latest
unimplemented: false
formula: [email protected]
version: 0.1.1-7e596de7ab4

# Vara macOS formulae
- os: macOS-latest
unimplemented: false
formula: vara
version: 0.1.6-78dfa07ed34

- os: macOS-latest
unimplemented: false
formula: [email protected]
version: 0.1.6-78dfa07ed34

- os: macOS-latest
unimplemented: false
formula: [email protected]
version: 0.1.4-5c685d0f15c

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.unimplemented }} # TODO: Remove after adding support for Linux
shamilsan marked this conversation as resolved.
Show resolved Hide resolved

steps:
- 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 add a tap from a PR's branch
shamilsan marked this conversation as resolved.
Show resolved Hide resolved
- name: Add Gear tap from PR's branch
if: false # github.event_name == 'pull_request'
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'
run: brew tap gear-tech/gear

- name: Test formula
run: |
brew install ${{ matrix.formula }}
gear --version && [ "$(gear --version)" = "gear ${{ matrix.version }}" ]
shamilsan marked this conversation as resolved.
Show resolved Hide resolved