generated from keploy/template
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from rishavmehra/rishavmehra/improvement
Rishavmehra/improvement
- Loading branch information
Showing
3 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters