From 8d5d4dd588b3e77dbdbe55b4612330bde3bf4540 Mon Sep 17 00:00:00 2001 From: Agarwal-Shivansh Date: Wed, 24 Jan 2024 10:15:03 -0800 Subject: [PATCH 1/8] GHA-integration initial commit --- .github/dependabot.yml | 20 ++++++++++ .github/workflows/master.yml | 76 ++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) 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..a842a26 --- /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-pci" + 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..c739a59 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,76 @@ +# 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: | + GOPRIVATE="github.com/onosproject/*" go build -o build/_output/onos-pci ./cmd/onos-pci + + 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-pci/pkg/... + go test -race github.com/onosproject/onos-pci/cmd/... + + 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-pci/Dockerfile -t onosproject/onos-pci:latest + rm -rf vendor + + 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: 9dc8fa92e3dd565687317beb87b56d89 From 074c682f33a635226ebae7a827ff8744e911737a Mon Sep 17 00:00:00 2001 From: gab-arrobo Date: Wed, 24 Jan 2024 18:11:30 -0500 Subject: [PATCH 2/8] Update master.yml --- .github/workflows/master.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index c739a59..6616fca 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -20,7 +20,7 @@ jobs: - name: Build run: | GOPRIVATE="github.com/onosproject/*" go build -o build/_output/onos-pci ./cmd/onos-pci - + lint: runs-on: ubuntu-latest steps: @@ -44,7 +44,7 @@ jobs: run: | go test -race github.com/onosproject/onos-pci/pkg/... go test -race github.com/onosproject/onos-pci/cmd/... - + docker-build: runs-on: ubuntu-latest steps: From 2320719a09d9d09fcc5e02f15ba25ffa2dfe6cf3 Mon Sep 17 00:00:00 2001 From: Agarwal-Shivansh <117628143+Agarwal-Shivansh@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:56:34 +0530 Subject: [PATCH 3/8] Update .github/workflows/master.yml Co-authored-by: gab-arrobo --- .github/workflows/master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 6616fca..c6c44d9 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -73,4 +73,4 @@ jobs: - name: FOSSA scan uses: fossa-contrib/fossa-action@v3 with: - fossa-api-key: 9dc8fa92e3dd565687317beb87b56d89 + fossa-api-key: ba71392b9c3bf6d4ba4e64edeae7f293 From cd3f036b43f6b2c63c3377b577601c21fdf75072 Mon Sep 17 00:00:00 2001 From: Agarwal-Shivansh <117628143+Agarwal-Shivansh@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:05:33 +0530 Subject: [PATCH 4/8] Update master.yml --- .github/workflows/master.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index c6c44d9..5d89036 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -6,7 +6,6 @@ on: push: branches: - master - - GHA-integration pull_request: jobs: From d73de60f5e38c914f897966b8135b8b970ad878a Mon Sep 17 00:00:00 2001 From: Agarwal-Shivansh <117628143+Agarwal-Shivansh@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:20:54 +0530 Subject: [PATCH 5/8] Update master.yml --- .github/workflows/master.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 5d89036..02f9746 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -6,6 +6,7 @@ on: push: branches: - master + - GHA-integration pull_request: jobs: @@ -17,8 +18,7 @@ jobs: with: go-version-file: 'go.mod' - name: Build - run: | - GOPRIVATE="github.com/onosproject/*" go build -o build/_output/onos-pci ./cmd/onos-pci + run: go build -o build/_output/onos-pci ./cmd/onos-pci lint: runs-on: ubuntu-latest From 9ab7a17946e6071b36038b39336b6a9866cb6a15 Mon Sep 17 00:00:00 2001 From: Agarwal-Shivansh <117628143+Agarwal-Shivansh@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:23:19 +0530 Subject: [PATCH 6/8] Update master.yml --- .github/workflows/master.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 02f9746..33c891c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -6,7 +6,6 @@ on: push: branches: - master - - GHA-integration pull_request: jobs: From a485b4fd06f018ce849006ed2ed51481959f9ed1 Mon Sep 17 00:00:00 2001 From: Agarwal-Shivansh <117628143+Agarwal-Shivansh@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:31:10 +0530 Subject: [PATCH 7/8] Update FOSSA action to keep API token as a secret --- .github/workflows/master.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 33c891c..9bd823c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -68,7 +68,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: FOSSA scan - uses: fossa-contrib/fossa-action@v3 + uses: fossas/fossa-action@main with: - fossa-api-key: ba71392b9c3bf6d4ba4e64edeae7f293 + api-key: ${{secrets.fossaApiKey}} From 692303415770414a7a098f8eddc4fdd72ae44215 Mon Sep 17 00:00:00 2001 From: gab-arrobo Date: Sat, 10 Feb 2024 03:14:02 -0500 Subject: [PATCH 8/8] Update action --- .github/workflows/master.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 9bd823c..b6d3a42 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -68,8 +68,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + - name: FOSSA scan - uses: fossas/fossa-action@main + uses: fossa-contrib/fossa-action@v3 with: - api-key: ${{secrets.fossaApiKey}} + fossa-api-key: 6d304c09a3ec097ba4517724e4a4d17d +