From e71bf29afd3e5a14aa06697fae74d67605b2fbf4 Mon Sep 17 00:00:00 2001 From: Aaron Brethorst Date: Mon, 19 Feb 2024 11:24:46 -0800 Subject: [PATCH] Add GitHub Actions yml file for validating PRs --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..55028f0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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