Skip to content

Commit

Permalink
Merge pull request #121 from rishavmehra/rishavmehra/improvement
Browse files Browse the repository at this point in the history
Rishavmehra/improvement
  • Loading branch information
khareyash05 authored Oct 7, 2024
2 parents 18404eb + 0bc9fed commit 3bce0bd
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build Go Sample Projects

on:
push:
branches:
- 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."
7 changes: 7 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion http-pokeapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type apiconfig struct {
}

func main() {
time.Sleep[2*time.Second]
time.Sleep(2 * time.Second)
cfg := &apiconfig{
client: pokeapi.Client{},
}
Expand Down

0 comments on commit 3bce0bd

Please sign in to comment.