-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions yml file for validating PRs
- Loading branch information
1 parent
1f38674
commit e71bf29
Showing
1 changed file
with
44 additions
and
0 deletions.
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,44 @@ | ||
name: Validate Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Compose | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Docker Compose up oba_bundler | ||
run: docker-compose up oba_bundler | ||
|
||
- name: Docker Compose up oba_app | ||
run: | | ||
docker-compose up oba_app | ||
sleep 30 | ||
- name: Validate script execution | ||
run: | | ||
success=false | ||
for i in {1..10}; do | ||
if ./bin/validate.sh; then | ||
echo "Validation succeeded on attempt $i" | ||
success=true | ||
break | ||
else | ||
echo "Validation failed on attempt $i, retrying in 10 seconds..." | ||
sleep 10 | ||
fi | ||
done | ||
if [ "$success" = false ]; then | ||
echo "Validation failed after 10 attempts" | ||
exit 1 | ||
fi | ||
shell: bash |