Skip to content

Commit dc6f73a

Browse files
GHA-integration commit (#5)
--------- Co-authored-by: gab-arrobo <gabriel.arrobo@intel.com>
1 parent 8e27cee commit dc6f73a

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed

.github/depandabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2024 Intel Corporation
3+
4+
version: 2
5+
updates:
6+
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
12+
- package-ecosystem: "docker"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
17+
- package-ecosystem: "gomod"
18+
directory: "/"
19+
schedule:
20+
interval: "weekly"

.github/workflows/master.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2024 Intel Corporation
3+
4+
name: Master workflow
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
11+
env:
12+
DOCKER_REPOSITORY: onosproject/
13+
ONOS_SDCORE_ADAPTER_VERSION: latest
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-go@v5
21+
with:
22+
go-version-file: 'go.mod'
23+
- name: Build
24+
run: go build -o build/_output/aether-mock-exporter ./cmd/aether-mock-exporter
25+
26+
lint:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-go@v5
31+
with:
32+
go-version-file: 'go.mod'
33+
- uses: golangci/golangci-lint-action@v4.0.0
34+
with:
35+
version: latest
36+
args: -v --config ./.golangci.yml --timeout=15m
37+
38+
unit-tests:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: actions/setup-go@v5
43+
with:
44+
go-version-file: 'go.mod'
45+
- name: Unit tests
46+
run: |
47+
go test -cover -race github.com/onosproject/aether-mock-exporter/pkg/...
48+
go test -cover -race github.com/onosproject/aether-mock-exporter/cmd/...
49+
50+
docker-build:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-go@v5
55+
with:
56+
go-version-file: 'go.mod'
57+
- name: Build Docker image
58+
run: docker build . -f Dockerfile -t ${DOCKER_REPOSITORY}aether-mock-exporter:${ONOS_SDCORE_ADAPTER_VERSION}
59+
60+
license-check:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: reuse lint
65+
uses: fsfe/reuse-action@v3
66+
67+
fossa-check:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: FOSSA scan
72+
uses: fossa-contrib/fossa-action@v3
73+
with:
74+
fossa-api-key: 6d304c09a3ec097ba4517724e4a4d17d

.golangci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-FileCopyrightText: 2019-present Open Networking Foundation <info@opennetworking.org>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
run:
6+
# Autogenerated files take too much time and memory to load,
7+
# even if we skip them with -skip-dirs or -skip-dirs;
8+
# or mark them as generated; or use nolint annotations.
9+
# So we define this tag and use it in the autogenerated files.
10+
build-tags:
11+
- codeanalysis
12+
13+
linters:
14+
enable:
15+
- gofmt
16+
- gocyclo
17+
# - revive
18+
- misspell
19+
- typecheck
20+
- errcheck
21+
- dogsled
22+
- unconvert
23+
- nakedret
24+
- exportloopref
25+
26+
issues:
27+
exclude-use-default: false
28+
exclude:
29+
- Error return value of `.*Close` is not checked
30+
- "package-comments: should have a package comment"

0 commit comments

Comments
 (0)