diff --git a/.github/workflows/build-tag-publish.yml b/.github/workflows/build-tag-publish.yml index cf76c1dc..27244be8 100644 --- a/.github/workflows/build-tag-publish.yml +++ b/.github/workflows/build-tag-publish.yml @@ -4,8 +4,6 @@ on: push: branches: - main - pull_request: - types: [opened, synchronize, reopened] jobs: build-gradle-project: @@ -15,6 +13,7 @@ jobs: - name: Checkout project sources uses: actions/checkout@v4 with: + ref: ${{ github.event.pull_request.merge_commit_sha }} fetch-depth: '0' - name: Set up JDK 17 diff --git a/.github/workflows/build-test-pr.yml b/.github/workflows/build-test-pr.yml new file mode 100644 index 00000000..74905bc8 --- /dev/null +++ b/.github/workflows/build-test-pr.yml @@ -0,0 +1,45 @@ +name: Gradle Build and Test Pull Requests to OpenHouse + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build-gradle-project: + name: Build Latest commit + runs-on: ubuntu-latest + steps: + - name: Checkout project sources using merge commit hash + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + distribution: 'microsoft' + java-version: '17' + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Build with Gradle + run: ./gradlew clean build + + - name: Start Docker Containers + run: docker compose -f infra/recipes/docker-compose/oh-only/docker-compose.yml up -d --build + + - name: Wait for Docker Containers to start + run: sleep 30 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install -r scripts/python/requirements.txt + + - name: Run Integration Tests + run: python scripts/python/integration_test.py ./tables-test-fixtures/tables-test-fixtures-iceberg-1.2/src/main/resources/dummy.token + + - name: Stop Docker Containers + run: docker compose -f infra/recipes/docker-compose/oh-only/docker-compose.yml down \ No newline at end of file