1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-16 11:37:36 +02:00
ferret/.github/workflows/main.yml

70 lines
2.0 KiB
YAML
Raw Normal View History

2020-06-23 04:28:43 +02:00
name: build
2020-06-17 22:35:58 +02:00
2020-06-23 04:01:39 +02:00
on: [push, pull_request]
2020-06-17 22:35:58 +02:00
jobs:
build:
name: Build
runs-on: ubuntu-latest
2020-06-22 23:32:27 +02:00
strategy:
matrix:
2020-06-22 23:33:11 +02:00
goVer: [1.12, 1.13, 1.14]
2020-06-17 22:35:58 +02: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 23:43:31 +02:00
env:
ANTLR_VERSION: 4.8
run: |
2020-06-22 23:56:37 +02:00
sudo curl -o /usr/local/lib/antlr-${ANTLR_VERSION}-complete.jar https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar
2020-06-22 23:55:07 +02:00
export CLASSPATH=".:/usr/local/lib/antlr-${ANTLR_VERSION}-complete.jar:$CLASSPATH"
2020-06-23 00:16:55 +02:00
mkdir $HOME/antlr-bin
2020-06-23 04:11:17 +02:00
echo -e '#!/bin/bash\njava -jar /usr/local/lib/antlr-4.8-complete.jar "$@"' > $HOME/antlr-bin/antlr
2020-06-23 00:16:55 +02:00
echo -e '#!/bin/bash\njava org.antlr.v4.gui.TestRig "$@"' > $HOME/antlr-bin/grun
chmod +x $HOME/antlr-bin/*
export PATH=$PATH:$HOME/antlr-bin
2020-06-22 23:59:16 +02:00
antlr
2020-06-17 22:35:58 +02:00
2020-06-23 04:18:19 +02:00
- name: Set up Lab
run: |
curl https://raw.githubusercontent.com/MontFerret/lab/master/install.sh -o install.sh
sudo sh install.sh
2020-06-22 23:43:31 +02:00
- name: Set up linters
2020-06-22 23:36:25 +02:00
run: go get -u github.com/mgechev/revive
2020-06-17 22:35:58 +02:00
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: make install
2020-06-23 00:09:11 +02:00
2020-06-17 22:35:58 +02:00
- 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 23:36:25 +02:00
2020-06-17 22:35:58 +02:00
- name: Generate
2020-06-23 04:18:19 +02:00
run: |
export PATH=$PATH:$HOME/antlr-bin
make generate
2020-06-22 23:36:25 +02:00
2020-06-17 22:35:58 +02:00
- name: Compile
run: make compile
2020-06-22 23:36:25 +02:00
2020-06-17 22:35:58 +02:00
- name: Unit tests
run: make cover
2020-06-22 23:36:25 +02:00
2020-06-17 22:35:58 +02: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)