From b720a3a0817a3b43b87a3927dba7765e00d42c36 Mon Sep 17 00:00:00 2001 From: Agarwal-Shivansh Date: Tue, 6 Feb 2024 05:12:20 -0800 Subject: [PATCH] GHA-integration initial commit --- .github/dependabot.yml | 15 +++++++++ .github/workflows/master.yml | 59 ++++++++++++++++++++++++++++++++++++ .golangci.yml | 4 +-- 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/master.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..115ce30 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 Intel Corporation + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..c807a0f --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 Intel Corporation + +name: Master workflow +on: + push: + branches: + - master + - GHA-integration + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Build + run: go build github.com/onosproject/onos-lib-go/pkg/... + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - uses: golangci/golangci-lint-action@v3.7.0 + with: + version: latest + args: -v --config ./.golangci.yml + + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Unit tests + run: go test -race github.com/onosproject/onos-lib-go/pkg/... + + license-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: reuse lint + uses: fsfe/reuse-action@v2 + + fossa-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: FOSSA scan + uses: fossa-contrib/fossa-action@v3 + with: + fossa-api-key: 6d304c09a3ec097ba4517724e4a4d17d \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index adf5ee0..63f8e3a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,13 +13,13 @@ run: linters: enable: - gofmt - - revive + # - revive - misspell - typecheck - errcheck - dogsled - unconvert - - nakedret + # - nakedret - exportloopref issues: