-
-
Notifications
You must be signed in to change notification settings - Fork 304
83 lines (68 loc) · 2.18 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: build
on: [push, pull_request]
jobs:
analyze:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.19'
- name: Set up linters
run: make install-tools
- name: Lint
run: |
make vet
make lint
make fmt
git diff
if [[ $(git diff) != '' ]]; then echo 'Invalid formatting!' >&2; exit 1; fi
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
goVer: [1.18, 1.19]
steps:
- name: Set up Go ${{ matrix.goVer }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.goVer }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up ANTLR
env:
ANTLR_VERSION: 4.11.1
run: |
sudo curl -o /usr/local/lib/antlr-${ANTLR_VERSION}-complete.jar https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar
export CLASSPATH=".:/usr/local/lib/antlr-${ANTLR_VERSION}-complete.jar:$CLASSPATH"
mkdir $HOME/antlr-bin
echo -e '#!/bin/bash\njava -jar /usr/local/lib/antlr-4.11.1-complete.jar "$@"' > $HOME/antlr-bin/antlr
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
antlr
- name: Set up Lab
run: |
curl https://raw.githubusercontent.com/MontFerret/lab/master/install.sh -o install.sh
chmod +x ./install.sh
LOCATION=$PWD ./install.sh
- name: Get dependencies
run: make install
- name: Generate
run: |
export PATH=$PATH:$HOME/antlr-bin
make generate
- name: Compile
run: make compile
- name: Unit tests
run: make cover
- name: E2E tests
run: |
docker run -d -p 9222:9222 ghcr.io/montferret/chromium:92.0.4512.0
LAB_BIN=$PWD/lab make e2e
docker stop $(docker ps -q)