-
Notifications
You must be signed in to change notification settings - Fork 38
70 lines (70 loc) · 2.36 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
70
---
name: Go
'on':
push:
branches-ignore:
- dependabot/**
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/[email protected]
- name: Set up Go
uses: actions/[email protected]
with:
go-version-file: 'go.mod'
cache: false
- 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/[email protected]
with:
files: ./coverage.txt
flags: unittests
verbose: true
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: SonarCloud Scan
uses: sonarsource/[email protected]
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
if: ${{ startsWith(matrix.os, 'ubuntu') }}