OV9.1 Validation #616
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
# if we don't do this, `gofmt` will want to rewrite all Go files due to bad line endings, | |
# because Git will convert all line endings to CRLF when cloning on windows | |
- name: Set Git to use Linux-style line endings | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.16 | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Format | |
run: if ! [ -z "$(find . -type f -name "*.go" -not -path "./vendor/*" | sed "s|^\./||" | xargs gofmt -l)" ]; then | |
echo -e " $(find . -type f -name "*.go" -not -path "./vendor/*" | sed "s|^\./||" | xargs gofmt -l)"; | |
exit 1; | |
fi | |
if: matrix.platform == 'ubuntu-latest' | |
- name: Vet | |
run: go vet $(go list ./... | grep -v '/vendor/') |