Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rishavmehra/improvement #121

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Go Sample Projects

on:
push:
branches:
- master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main would suffice

- 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
Loading