From 37a6573ce82f0a6b3052d15879e6a18be4593964 Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 13:54:43 -0400 Subject: [PATCH 01/11] ADD test to all branches for changes --- .github/workflows/image_creation.yaml | 8 +++++--- .github/workflows/test_workflow.yml | 28 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test_workflow.yml diff --git a/.github/workflows/image_creation.yaml b/.github/workflows/image_creation.yaml index dcffe22..6de4781 100644 --- a/.github/workflows/image_creation.yaml +++ b/.github/workflows/image_creation.yaml @@ -1,8 +1,6 @@ -name: Build Push +name: Build Push Prod on: push: - branches: - - master tags: - '*' jobs: @@ -16,6 +14,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Exit if not on master + if: endsWith(github.ref, master) == false + run: exit 1 + - name: Setup Quemu uses: docker/setup-qemu-action@v3 diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml new file mode 100644 index 0000000..8466507 --- /dev/null +++ b/.github/workflows/test_workflow.yml @@ -0,0 +1,28 @@ +name: dev workflow +on: + push: + branches: + - main + - dev + - 'feature/**' +jobs: + build: + runs-on: ubuntu-latest + env: + TOKEN: ${{ secrets.TOKEN }} + USERNAME: ${{ vars.USERNAME }} + TAG_VERSION: ${{ github.ref_name }} + steps: + - name: + uses: actions/checkout@v4 + + - name: Setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Build + run: go build -v ./... + + - name: test with go + run: go test -v ./... -- 2.39.5 From 4d1e262afd62eee9f84d760b397908f0f688f287 Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 13:56:09 -0400 Subject: [PATCH 02/11] RENAMe jub --- .github/workflows/test_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 8466507..7160568 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -16,7 +16,7 @@ jobs: - name: uses: actions/checkout@v4 - - name: Setup Go ${{ matrix.go-version }} + - name: Setup Go uses: actions/setup-go@v5 with: go-version-file: 'go.mod' -- 2.39.5 From 353b0463440abad954f98e7ff0cf2f3d47cb0b8e Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:09:06 -0400 Subject: [PATCH 03/11] ADD vuklln check --- .github/workflows/test_workflow.yml | 30 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 7160568..f209f3e 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -6,23 +6,31 @@ on: - dev - 'feature/**' jobs: - build: + env: + TOKEN: ${{ secrets.TOKEN }} + USERNAME: ${{ vars.USERNAME }} + TAG_VERSION: ${{ github.ref_name }} + test: runs-on: ubuntu-latest - env: - TOKEN: ${{ secrets.TOKEN }} - USERNAME: ${{ vars.USERNAME }} - TAG_VERSION: ${{ github.ref_name }} - steps: - - name: + steps: + - name: Checkout code uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - - - name: Build - run: go build -v ./... - + - name: test with go run: go test -v ./... + + vulnCheck: + runs-on: ubuntu-latest + steps: + - name: checkout Code + uses: actions/checkout@v4 + + - name: go vuln check + uses: golang/govulncheck-action@v1 + with: + go-version-file: 'go.mod' -- 2.39.5 From 7c7c359954f44863c7e213a9885551fe5dedc74a Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:11:28 -0400 Subject: [PATCH 04/11] ADD feature to run --- .github/workflows/test_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index f209f3e..b0f9f97 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -4,7 +4,7 @@ on: branches: - main - dev - - 'feature/**' + - feature/* jobs: env: TOKEN: ${{ secrets.TOKEN }} -- 2.39.5 From 2caa61e3a3927a16256abc9d5ca86811122a7fb4 Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:17:55 -0400 Subject: [PATCH 05/11] ADD path to pull request --- .github/workflows/test_workflow.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index b0f9f97..b086cc9 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -4,7 +4,11 @@ on: branches: - main - dev - - feature/* + - 'feature/**' + pull_request: + paths: + - '**.go' + jobs: env: TOKEN: ${{ secrets.TOKEN }} -- 2.39.5 From b93c7cdfd2b007e1eff6e8fee0fe6b9be9637b2d Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:20:28 -0400 Subject: [PATCH 06/11] CHANGED to all push --- .github/workflows/test_workflow.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index b086cc9..72ba08e 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -2,9 +2,7 @@ name: dev workflow on: push: branches: - - main - - dev - - 'feature/**' + - '*' pull_request: paths: - '**.go' -- 2.39.5 From c2aa4b82e50451cae56055ef8a67ad3315b047d2 Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:21:41 -0400 Subject: [PATCH 07/11] FIX typo --- .github/workflows/test_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 72ba08e..f120c89 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -14,7 +14,7 @@ jobs: TAG_VERSION: ${{ github.ref_name }} test: runs-on: ubuntu-latest - steps: + steps: - name: Checkout code uses: actions/checkout@v4 -- 2.39.5 From c93003055c161c48da1b81cf2d230dc3bea1b4be Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:22:54 -0400 Subject: [PATCH 08/11] ADD env to steps --- .github/workflows/test_workflow.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index f120c89..57663fd 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -8,11 +8,11 @@ on: - '**.go' jobs: - env: - TOKEN: ${{ secrets.TOKEN }} - USERNAME: ${{ vars.USERNAME }} - TAG_VERSION: ${{ github.ref_name }} test: + env: + TOKEN: ${{ secrets.TOKEN }} + USERNAME: ${{ vars.USERNAME }} + TAG_VERSION: ${{ github.ref_name }} runs-on: ubuntu-latest steps: - name: Checkout code @@ -27,6 +27,10 @@ jobs: run: go test -v ./... vulnCheck: + env: + TOKEN: ${{ secrets.TOKEN }} + USERNAME: ${{ vars.USERNAME }} + TAG_VERSION: ${{ github.ref_name }} runs-on: ubuntu-latest steps: - name: checkout Code -- 2.39.5 From bbf2a8d354eec17340501827075542456c282be6 Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:25:32 -0400 Subject: [PATCH 09/11] FIX sintax --- .github/workflows/test_workflow.yml | 37 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 57663fd..2cea17c 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -9,34 +9,35 @@ on: jobs: test: + runs-on: ubuntu-latest env: TOKEN: ${{ secrets.TOKEN }} USERNAME: ${{ vars.USERNAME }} TAG_VERSION: ${{ github.ref_name }} - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 + steps: + - name: Checkout code + uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' - - name: test with go - run: go test -v ./... + - name: test with go + run: go test -v ./... vulnCheck: + runs-on: ubuntu-latest env: TOKEN: ${{ secrets.TOKEN }} USERNAME: ${{ vars.USERNAME }} TAG_VERSION: ${{ github.ref_name }} - runs-on: ubuntu-latest - steps: - - name: checkout Code - uses: actions/checkout@v4 - - name: go vuln check - uses: golang/govulncheck-action@v1 - with: - go-version-file: 'go.mod' + steps: + - name: checkout Code + uses: actions/checkout@v4 + + - name: go vuln check + uses: golang/govulncheck-action@v1 + with: + go-version-file: 'go.mod' -- 2.39.5 From 45230f4627bd017a697464cbacc25776be31e03b Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:26:54 -0400 Subject: [PATCH 10/11] ADD feature branch to trigger --- .github/workflows/test_workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 2cea17c..60da79f 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -3,6 +3,7 @@ on: push: branches: - '*' + - 'feature/**' pull_request: paths: - '**.go' -- 2.39.5 From 5f0f92ebdab4a4010907690870019c6e7ab451a7 Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Sat, 16 Nov 2024 22:29:06 -0400 Subject: [PATCH 11/11] Test trigger --- .github/workflows/test_workflow.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_workflow.yml b/.github/workflows/test_workflow.yml index 60da79f..2619a82 100644 --- a/.github/workflows/test_workflow.yml +++ b/.github/workflows/test_workflow.yml @@ -2,8 +2,11 @@ name: dev workflow on: push: branches: - - '*' - - 'feature/**' + - main + - dev + - '*' + - feature/** + - 'feature/**' pull_request: paths: - '**.go' -- 2.39.5