diff --git a/.github/workflows/sql-explain-hook.yml b/.github/workflows/sql-explain-hook.yml new file mode 100644 index 000000000..54e8cb85c --- /dev/null +++ b/.github/workflows/sql-explain-hook.yml @@ -0,0 +1,40 @@ +name: Sql Explain Hook + +on: + pull_request: + branches: ["main"] + workflow_dispatch: + +env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + + +jobs: + sql-explain-hook: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: "17" + distribution: "temurin" + + - name: Jooq Code Generation + run: | + ./gradlew --info jooqCodegenAll + + - name: Generate Explain Docs + run: | + ./gradlew --info api-repo:generateExplainDocs + + - name: Zip Explain Docs + run: | + zip explain-docs.zip -r ./api-repo/src/test/resources/explain/* + + - name: Upload Explain Docs + run: | + curl \ + -F 'payload_json={"username": "GitHubAction", "content": "SqlExplainHook - PR: ${{ github.event.pull_request.number }}"}' \ + -F "file1=@explain-docs.zip" \ + $DISCORD_WEBHOOK