From 846f36d77ff1c8d134c9dfeb101ec824c213fbbc Mon Sep 17 00:00:00 2001 From: Jaime Date: Thu, 24 Sep 2026 17:00:37 +0200 Subject: [PATCH 1/4] Add run-tests job to workflow --- .github/workflows/workflow.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..1e3cfbe --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,32 @@ +name: main-worklfow + +env: {} + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + # Run all unit tests. + run-tests: + runs-on: ubuntu-latest + steps: + # Check out the pull request's source code. + - name: Check out source code + uses: actions/checkout@v3 + + # Install Go. + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: "^1.14" # The Go version to download and use. + - name: Print Go version + run: go version + + # Run unit tests. + - name: Run unit tests + run: go test -v ./... \ No newline at end of file From 9f1c3abb875d5c756c86b967a82537ebe68f74a2 Mon Sep 17 00:00:00 2001 From: Jaime Date: Thu, 24 Sep 2026 17:08:58 +0200 Subject: [PATCH 2/4] Introduce breaking change --- foobar/foobar.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foobar/foobar.go b/foobar/foobar.go index 1416c8e..b9289d5 100644 --- a/foobar/foobar.go +++ b/foobar/foobar.go @@ -18,7 +18,7 @@ func Sequence(length int) ([]string, error) { for i := range seq { n := i + 1 switch { - case n%3 == 0 && n%5 == 0: + case n%3 == 0 && n%7 == 0: seq[i] = "foobar" case n%5 == 0: seq[i] = "bar" From 621e1c6de12a3a7f1025c25110b66ad85e91a48f Mon Sep 17 00:00:00 2001 From: Jaime Date: Thu, 24 Sep 2026 17:18:37 +0200 Subject: [PATCH 3/4] Introduce breaking change --- foobar/foobar.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foobar/foobar.go b/foobar/foobar.go index b9289d5..1416c8e 100644 --- a/foobar/foobar.go +++ b/foobar/foobar.go @@ -18,7 +18,7 @@ func Sequence(length int) ([]string, error) { for i := range seq { n := i + 1 switch { - case n%3 == 0 && n%7 == 0: + case n%3 == 0 && n%5 == 0: seq[i] = "foobar" case n%5 == 0: seq[i] = "bar" From cb9bf6a1563cce56434b34fc4de7e12d0f47ab9f Mon Sep 17 00:00:00 2001 From: Jaime Date: Thu, 24 Sep 2026 17:43:28 +0200 Subject: [PATCH 4/4] Add build-and-release job to workflow --- .github/workflows/workflow.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1e3cfbe..1d40129 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -29,4 +29,24 @@ jobs: # Run unit tests. - name: Run unit tests - run: go test -v ./... \ No newline at end of file + run: go test -v ./... + + # Build and release. +build-and-release: + runs-on: ubuntu-latest + steps: + # Check out source code. + - name: Check out source code + uses: actions/checkout@v3 + + # Build and push container image. + - name: Build and push container image + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.IMAGE_REPOSITORY }} + tag_with_ref: true + tag_with_sha: true # sha-${GITHUB_SHA::7} + + \ No newline at end of file