diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1603642 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: tests +on: + push: + branches: + - main + pull_request: + branches: + - main + release: + types: + - published +jobs: + tests: + strategy: + matrix: + os: + - macos-latest + - ubuntu-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Install fish shell + uses: fish-actions/install-fish@v1.1.0 + - name: Create syntactically valid fish shell function + run: | + cat << EOF >./valid-syntax.fish + function valid-syntax + echo "valid-syntax" + end + EOF + - if: github.event_name != 'pull_request' + name: Syntax check valid fish file using action from main branch + uses: fish-shop/syntax-check@main + with: + pattern: valid-syntax.fish + - if: github.event_name == 'pull_request' + name: Syntax check valid fish file using action from pull-request branch + uses: ./. + with: + pattern: valid-syntax.fish