-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (42 loc) · 1.77 KB
/
test.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
name: test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: download go
run: curl -O https://dl.google.com/go/go1.23.2.linux-amd64.tar.gz
- name: unpack go
run: tar xf go1.23.2.linux-amd64.tar.gz
- name: install go
run: sudo mkdir -p /usr/local/mdb && sudo mv go /usr/local/mdb/
- name: install goyacc
run: PATH=/usr/local/mdb/go/bin:$PATH go install golang.org/x/tools/cmd/goyacc@master
# - name: install vet shadow
# run: PATH=/usr/local/mdb/go/bin:$PATH go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
# - name: install errcheck
# run: PATH=/usr/local/mdb/go/bin:$PATH go install github.com/kisielk/errcheck@latest
# - name: install ineffassign
# run: PATH=/usr/local/mdb/go/bin:$PATH go install github.com/gordonklaus/ineffassign@latest
# - name: install deadcode
# run: PATH=/usr/local/mdb/go/bin:$PATH go install github.com/remyoudompheng/go-misc/deadcode@latest
- name: install ragel
run: sudo apt install ragel
- name: build metadb
run: PATH=$HOME/go/bin:/usr/local/mdb/go/bin:$PATH ./build
- name: run metadb
run: ./bin/metadb help
- name: build marct
run: go build -o bin ./cmd/marct
- name: run marct
run: ./bin/marct -h
- name: create test coverage out file
run: go test -json -coverprofile=coverage.out ./... > report.json
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}