From 3ac3f64ed90a132568e7093972683a9fb208a316 Mon Sep 17 00:00:00 2001 From: Daylon Wilkins Date: Fri, 24 May 2024 03:30:48 -0700 Subject: [PATCH] Added workflows for checking integrators --- .github/workflows/dependency-test.yml | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/dependency-test.yml diff --git a/.github/workflows/dependency-test.yml b/.github/workflows/dependency-test.yml new file mode 100644 index 0000000000..1d34809ea6 --- /dev/null +++ b/.github/workflows/dependency-test.yml @@ -0,0 +1,63 @@ +name: Test Integration with Dolt and DoltgreSQL +on: [pull_request] + +jobs: + test-integration: + runs-on: ubuntu-latest + + steps: + - name: Checkout go-mysql-server + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Clone Dolt + run: git clone https://github.com/dolthub/dolt.git + + - name: Clone DoltgreSQL repository + run: git clone https://github.com/dolthub/doltgresql.git + + - name: Update Dolt's dependency + run: | + cd dolt/go + go get github.com/dolthub/go-mysql-server@${{ github.event.pull_request.head.sha }} + go mod tidy + + - name: Update DoltgreSQL's dependency + run: | + cd doltgresql + ./postgres/parser/build.sh + go get github.com/dolthub/go-mysql-server@${{ github.event.pull_request.head.sha }} + go mod tidy + + - name: Test Dolt + run: | + cd dolt/go/libraries/doltcore/sqle/enginetest + go test ./... --count=1 || echo "dolt-tests-failed" > $GITHUB_WORKSPACE/dolt-test-result.txt + + - name: Test DoltgreSQL + run: | + cd doltgresql/testing/go + go test ./... --count=1 -skip Replication || echo "doltgresql-tests-failed" > $GITHUB_WORKSPACE/doltgresql-test-result.txt + + - name: Comment on failures + if: always() + run: | + TEST_COMMENT="" + if [ -f $GITHUB_WORKSPACE/dolt-test-result.txt ]; then + TEST_COMMENT="Additional work is required for integration with [Dolt](https://github.com/dolthub/dolt).\n" + fi + if [ -f $GITHUB_WORKSPACE/doltgresql-test-result.txt ]; then + TEST_COMMENT="${TEST_COMMENT}Additional work is required for integration with [DoltgreSQL](https://github.com/dolthub/doltgresql).\n" + fi + if [ -n "$TEST_COMMENT" ]; then + curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -X POST \ + -d "{\"body\": \"$TEST_COMMENT\"}" \ + "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" + fi