-
Notifications
You must be signed in to change notification settings - Fork 38
69 lines (69 loc) · 2.48 KB
/
go.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
---
name: Go
'on': push
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
shasum: shasum -a 512
- os: ubuntu-latest
shasum: sha512sum
- os: windows-latest
shasum: sha512sum
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.0
- name: Unit tests
run: |
go test -short -cover -v -coverprofile=coverage.txt \
-covermode=atomic $(go list ./... |\
grep -v internal/app/n3dr/goswagger |\
grep -v internal/app/n3dr/n3drtest |\
grep -v cmd/n3dr)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
flags: unittests
verbose: true
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=030-github
-Dsonar.projectKey=030_n3dr
-Dsonar.exclusions=test/testdata/**,internal/app/n3dr/goswagger/**
-Dsonar.sources=.
-Dsonar.coverage.exclusions=**/*_test.go,test/testdata/**,internal/app/n3dr/goswagger/**/*,cmd/**/*
-Dsonar.verbose=true
-Dsonar.go.coverage.reportPaths="coverage.txt"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: Set N3DR deliverable environment variable
run: echo "n3dr-deliverable=n3dr-${{ matrix.os }}" >> $GITHUB_ENV
- name: Use the value
run: |
echo "${{ env.n3dr-deliverable }}"
- name: Build
run: ./scripts/build.sh
env:
N3DR_DELIVERABLE: ${{ env.n3dr-deliverable }}
SHA512_CMD: ${{ matrix.shasum }}
- name: Quality
run: |
docker run --rm -v "$PWD:/mnt" koalaman/shellcheck:v0.7.1 */*.sh -x
docker run --rm -v ${PWD}:/data markdownlint/markdownlint:0.11.0 \
README.md -s /data/configs/.markdownlint.rb
docker run --rm -v $(pwd):/app -w /app -e GOFLAGS=-buildvcs=false \
golangci/golangci-lint:v1.54.2-alpine golangci-lint run -v \
--timeout 2m30s --config configs/.golangci.yml
if: ${{ startsWith(matrix.os, 'ubuntu') }}