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