From debdf154aba0e35bcdf52fcb0dcf00100952599b Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 11:38:53 +0100 Subject: [PATCH 01/13] Create test.yml --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0571967 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Vet + run: go vet -v ./... + + - name: Test + run: go test -v ./... From 9718d18d57896a25ffc4299f5b8b69366f0f9cd0 Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 11:44:42 +0100 Subject: [PATCH 02/13] Update and rename test.yml to actions.yml --- .github/workflows/{test.yml => actions.yml} | 5 +++++ 1 file changed, 5 insertions(+) rename .github/workflows/{test.yml => actions.yml} (78%) diff --git a/.github/workflows/test.yml b/.github/workflows/actions.yml similarity index 78% rename from .github/workflows/test.yml rename to .github/workflows/actions.yml index 0571967..3b36079 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/actions.yml @@ -26,3 +26,8 @@ jobs: - name: Test run: go test -v ./... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 9b9565e7b60dd85c1eeb22bdd5bb82c94ca3ab03 Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 12:13:42 +0100 Subject: [PATCH 03/13] split actions and rename --- .../workflows/{actions.yml => coverage.yml} | 8 +----- .github/workflows/tests.yml | 28 +++++++++++++++++++ README.md | 13 +++++++-- 3 files changed, 40 insertions(+), 9 deletions(-) rename .github/workflows/{actions.yml => coverage.yml} (85%) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/coverage.yml similarity index 85% rename from .github/workflows/actions.yml rename to .github/workflows/coverage.yml index 3b36079..1bd0af5 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/coverage.yml @@ -1,7 +1,7 @@ # This workflow will build a golang project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go -name: Go +name: Run Coverage on: push: @@ -21,12 +21,6 @@ jobs: with: go-version: '1.22' - - name: Vet - run: go vet -v ./... - - - name: Test - run: go test -v ./... - - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..4b13b6a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,28 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Run Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Vet + run: go vet -v ./... + + - name: Test + run: go test -v ./... diff --git a/README.md b/README.md index 2fbc70d..746a99c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ -
- Workflow Logo +
+ Workflow Logo +
+ ## Workflow is a Golang workflow framework that encompasses these main features: - Defining small units of work called "Steps" - Consumer management and graceful shutdown From 6c1e6bbd4949c84c3f9d8c0ccfc93f2b8ff7f071 Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 12:18:04 +0100 Subject: [PATCH 04/13] fix readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 746a99c..fbea0f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -
+
Workflow Logo -
+
From 8ecd66d7cc7bc5f458ea0290e8d197d7165af590 Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 12:21:31 +0100 Subject: [PATCH 05/13] merge coverage with go test --- .github/workflows/coverage.yml | 27 --------------------------- .github/workflows/tests.yml | 7 ++++++- 2 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 1bd0af5..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Run Coverage - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.22' - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b13b6a..28cb6f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,10 +19,15 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.22' + go-version: ['1.21', '1.22', '1'] - name: Vet run: go vet -v ./... - name: Test run: go test -v ./... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 2d854eb52253c57d81dbac580a583d931c57315f Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 12:25:12 +0100 Subject: [PATCH 06/13] use go version matrix config --- .github/workflows/tests.yml | 5 ++++- README.md | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 28cb6f9..155253a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,9 @@ on: jobs: build: + strategy: + matrix: + go: [ '1.21', '1.22', '1' ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -19,7 +22,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ['1.21', '1.22', '1'] + go-version: ${{ matrix.go }} - name: Vet run: go vet -v ./... diff --git a/README.md b/README.md index fbea0f6..05f9736 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ + + +
From eb767e96e3fb2042b4d5d04113c33f2dfb3695f3 Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 12:58:13 +0100 Subject: [PATCH 07/13] use sonar cloud coverage --- .github/workflows/sonar.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/sonar.yaml diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml new file mode 100644 index 0000000..81a884c --- /dev/null +++ b/.github/workflows/sonar.yaml @@ -0,0 +1,33 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Sonar Report + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + strategy: + matrix: + go: [ '1.21', '1.22', '1' ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go }} + + - name: Generate Sonar Report + run: go test -coverprofile=coverage.out -json ./... > sonar-report.json + + - name: Upload coverage reports to Sonar + uses: sonarsource/sonarcloud-github-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 5b41734bd307cc6e3258cb67d01782a716a08f5c Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 13:16:04 +0100 Subject: [PATCH 08/13] add sonar config --- sonar-project.properties | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..3ab54b2 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.organization = luno +sonar.projectKey = luno:workflow +sonar.projectName = Workflow +sonar.links.scm = https://github.com/luno/workflow + +sonar.sources = . +sonar.exclusions=**/*_test.go +sonar.go.coverage.reportPaths = coverage.out +sonar.go.tests.reportPaths = sonar-report.json +sonar.tests = . +sonar.test.inclusions = **/*_test.go \ No newline at end of file From 394fd43067da3bc266cbab231753c5271ab96cda Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 13:17:33 +0100 Subject: [PATCH 09/13] remove sonar matrix --- .github/workflows/sonar.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 81a884c..5a2e1d3 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -12,9 +12,6 @@ on: jobs: build: - strategy: - matrix: - go: [ '1.21', '1.22', '1' ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -22,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go }} + go-version: '1.22' - name: Generate Sonar Report run: go test -coverprofile=coverage.out -json ./... > sonar-report.json From 0c8cf49badd010fb7e9a8c9524f96a59ea6ca271 Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 13:22:38 +0100 Subject: [PATCH 10/13] fix sonar project key --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 3ab54b2..6b4472f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ sonar.organization = luno -sonar.projectKey = luno:workflow +sonar.projectKey = luno_workflow sonar.projectName = Workflow sonar.links.scm = https://github.com/luno/workflow From 3e2096f3c62c60a2de332aca18c80b8ce6fa53fe Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 13:42:46 +0100 Subject: [PATCH 11/13] fix sonar project name --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 6b4472f..8dabef3 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ sonar.organization = luno sonar.projectKey = luno_workflow -sonar.projectName = Workflow +sonar.projectName = workflow sonar.links.scm = https://github.com/luno/workflow sonar.sources = . From 3d901fbce03ca3057f8170f997edf8089436f36e Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 13:53:50 +0100 Subject: [PATCH 12/13] addd vanity badges --- README.md | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 05f9736..7ac30c4 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,32 @@
Workflow Logo - From 809272cabcd8dc421f8b70df5956f5a4bec9f279 Mon Sep 17 00:00:00 2001 From: Andrew Wormald Date: Fri, 9 Aug 2024 14:09:22 +0100 Subject: [PATCH 13/13] remove codecov --- .github/workflows/tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 155253a..664fadc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,8 +29,3 @@ jobs: - name: Test run: go test -v ./... - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }}