2020-06-17 16:35:58 -04:00
|
|
|
name: Go
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
2020-06-22 17:32:27 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-06-22 17:33:11 -04:00
|
|
|
goVer: [1.12, 1.13, 1.14]
|
2020-06-17 16:35:58 -04:00
|
|
|
steps:
|
|
|
|
- name: Set up Go ${{ matrix.goVer }}
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.goVer }}
|
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Set up ANTLR
|
2020-06-22 17:43:31 -04:00
|
|
|
env:
|
|
|
|
ANTLR_VERSION: 4.8
|
|
|
|
run: |
|
2020-06-22 17:50:17 -04:00
|
|
|
sudo apt-get install -y antlr4
|
|
|
|
alias antlr=antlr4
|
2020-06-17 16:35:58 -04:00
|
|
|
|
2020-06-22 17:43:31 -04:00
|
|
|
- name: Set up linters
|
2020-06-22 17:36:25 -04:00
|
|
|
run: go get -u github.com/mgechev/revive
|
|
|
|
|
2020-06-17 16:35:58 -04:00
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Get dependencies
|
|
|
|
run: make install
|
|
|
|
- name: Lint
|
|
|
|
run: |
|
|
|
|
make vet
|
|
|
|
make lint
|
|
|
|
make fmt
|
|
|
|
git diff
|
|
|
|
if [[ $(git diff) != '' ]]; then echo 'Invalid formatting!' >&2; exit 1; fi
|
2020-06-22 17:36:25 -04:00
|
|
|
|
2020-06-17 16:35:58 -04:00
|
|
|
- name: Generate
|
|
|
|
run: make generate
|
2020-06-22 17:36:25 -04:00
|
|
|
|
2020-06-17 16:35:58 -04:00
|
|
|
- name: Compile
|
|
|
|
run: make compile
|
2020-06-22 17:36:25 -04:00
|
|
|
|
2020-06-17 16:35:58 -04:00
|
|
|
- name: Unit tests
|
|
|
|
run: make cover
|
2020-06-22 17:36:25 -04:00
|
|
|
|
2020-06-17 16:35:58 -04:00
|
|
|
- name: E2E tests
|
|
|
|
run: |
|
|
|
|
docker run -d -p 9222:9222 -e CHROME_OPTS='--disable-dev-shm-usage --full-memory-crash-report' alpeware/chrome-headless-stable:ver-83.0.4103.61
|
|
|
|
make e2e
|
|
|
|
docker stop $(docker ps -q)
|