diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..aa57fd173 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 Intel Corporation + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "docker" + directory: "build/onos-config" + schedule: + interval: "weekly" + + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 000000000..70013b398 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2024 Intel Corporation + +name: Master workflow +on: + push: + branches: + - master + 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 mod vendor + go build -mod=vendor -o build/_output/onos-config ./cmd/onos-config + rm -rf vendor + + 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@v4.0.0 + with: + version: latest + args: -v --config ./.golangci.yml --timeout=15m + + 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 ./... + + docker-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Build Docker image + run: | + git clone https://github.com/onosproject/build-tools.git build/build-tools + go mod vendor + docker build . -f build/onos-config/Dockerfile -t onosproject/onos-config:latest + rm -rf vendor + + license-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: reuse lint + uses: fsfe/reuse-action@v3 + + 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 diff --git a/.golangci.yml b/.golangci.yml index 9c961ea0c..0d037c905 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,7 +13,7 @@ run: linters: enable: - gofmt - - revive + # - revive - misspell - typecheck - errcheck