From 8c0d56512fe865aef5691f1d8532e3256ff3a799 Mon Sep 17 00:00:00 2001 From: Rishav Mehra Date: Fri, 4 Oct 2024 00:35:17 +0530 Subject: [PATCH 1/4] refactor: integrate existing applications into CI linting process Signed-off-by: Rishav Mehra --- .github/workflows/golangci-lint.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 9f4248a9..08fa2d79 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -26,10 +26,17 @@ jobs: fail-fast: false matrix: working-directory: + - echo-mysql - echo-sql + - fasthttp-postgres - gin-mongo - gin-redis + - go-jwt + - go-twilio - graphql-sql + - http-pokeapi + - mux-elasticsearch + - mux-mysql - mux-sql - S3-Keploy - sse-svelte From 678657852fe6231c92db85f1f8f4cb433e9d5794 Mon Sep 17 00:00:00 2001 From: Rishav Mehra Date: Fri, 4 Oct 2024 00:38:06 +0530 Subject: [PATCH 2/4] fix: correct syntax for time.Sleep function Signed-off-by: Rishav Mehra --- http-pokeapi/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http-pokeapi/main.go b/http-pokeapi/main.go index b12daffe..3e3af927 100644 --- a/http-pokeapi/main.go +++ b/http-pokeapi/main.go @@ -14,7 +14,7 @@ type apiconfig struct { } func main() { - time.Sleep[2*time.Second] + time.Sleep(2 * time.Second) cfg := &apiconfig{ client: pokeapi.Client{}, } From cbc12fab744c5e728e6183643490c83fc2d5df41 Mon Sep 17 00:00:00 2001 From: Rishav Mehra Date: Fri, 4 Oct 2024 00:41:20 +0530 Subject: [PATCH 3/4] feat(actions): add new build.yml for build the golang sample projects Signed-off-by: Rishav Mehra --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..5a0207b2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build Go Sample Projects + +on: + push: + branches: + - master + - main + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.22' + + - name: Build projects + run: | + #!/bin/bash + cd /home/runner/work/samples-go/samples-go + + for dir in */; do + if [ -d "$dir" ] && [ -f "${dir}go.mod" ]; then + echo "Building project in $dir" + + # Change to the project directory + cd "$dir" || continue + + # Build the project + if go build -o app; then + echo "Successfully built $dir" + else + echo "Failed to build $dir" >&2 + exit 1 + fi + + # Return to the base directory + cd .. + else + echo "Skipping $dir, no go.mod file found." + fi + done + + echo "All projects processed." From 0bc9fed68d8b59e8f926b178c3a9e7744588c370 Mon Sep 17 00:00:00 2001 From: Rishav Mehra Date: Mon, 7 Oct 2024 14:35:43 +0530 Subject: [PATCH 4/4] branch fix Signed-off-by: Rishav Mehra --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a0207b2..833173bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,6 @@ name: Build Go Sample Projects on: push: branches: - - master - main pull_request: types: [opened, edited, synchronize, reopened]