Fix extractFromSemiStructured in duckdbExtension #18756
Workflow file for this run
This file contains hidden or 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
| # Copyright 2022 Goldman Sachs | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Build CI | |
| env: | |
| CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} | |
| CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'legend-release-*' | |
| - 'release-legend-release-*' | |
| pull_request: | |
| branches: | |
| - master | |
| - 'legend-release-*' | |
| - 'release-legend-release-*' | |
| workflow_dispatch: | |
| inputs: | |
| pure_ref: | |
| description: "legend-pure branch or PR ref (e.g. 'my-branch' or 'refs/pull/123/merge'). Leave empty for normal build." | |
| required: false | |
| default: "" | |
| type: string | |
| pure_repo: | |
| description: "legend-pure repository (owner/repo)" | |
| required: false | |
| default: "finos/legend-pure" | |
| type: string | |
| # Cancel running jobs from previous pipelines of the same workflow on PR to save resource when commits are pushed quickly | |
| # NOTE: we don't want this behavior on default branch | |
| # See https://stackoverflow.com/a/68422069 | |
| concurrency: | |
| group: ${{ github.ref == 'refs/heads/master' && format('ci-default-branch-{0}-{1}', github.sha, github.workflow) || format('ci-pr-{0}-{1}', github.ref, github.workflow) }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-pure: | |
| name: Build legend-pure snapshot | |
| if: inputs.pure_ref != '' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| pure_version: ${{ steps.extract-version.outputs.version }} | |
| steps: | |
| - name: Checkout legend-pure | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ inputs.pure_repo }} | |
| ref: ${{ inputs.pure_ref }} | |
| path: legend-pure | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 11 | |
| distribution: 'zulu' | |
| - name: Cache Maven dependencies (pure) | |
| uses: actions/cache@v5 | |
| env: | |
| cache-name: cache-mvn-deps-pure | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-pure-${{ env.cache-name }}-${{ hashFiles('legend-pure/**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pure-${{ env.cache-name }}- | |
| - name: Extract legend-pure version | |
| id: extract-version | |
| working-directory: legend-pure | |
| run: | | |
| VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| echo "Legend-pure version: $VERSION" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Build and install legend-pure | |
| working-directory: legend-pure | |
| env: | |
| MAVEN_OPTS: "-Xmx4g" | |
| run: mvn -B -e clean install -DskipTests | |
| - name: Upload local Maven repo (legend-pure artifacts) | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pure-m2-snapshot | |
| path: ~/.m2/repository/org/finos/legend/pure/ | |
| retention-days: 1 | |
| if-no-files-found: error | |
| build: | |
| name: Build | |
| # NOTE: Only run this when not in fork as those likely do not have access to larger runners and will fail on normal runner due to resource limitation | |
| # Also, skip this build for release commits | |
| if: always() && needs.build-pure.result != 'failure' && !contains(github.event.head_commit.message, '[maven-release-plugin]') && github.repository == 'finos/legend-engine' | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-pure | |
| outputs: | |
| testMatrix: ${{ steps.testMatrix.outputs.testMatrix }} | |
| profiles: ${{ steps.requiredSecrets.outputs.PROFILES }} | |
| pureVersionArg: ${{ steps.pureVersion.outputs.arg }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@v5 | |
| env: | |
| cache-name: cache-mvn-deps | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 11 | |
| distribution: 'zulu' | |
| server-id: central | |
| server-username: CI_DEPLOY_USERNAME | |
| server-password: CI_DEPLOY_PASSWORD | |
| - name: Check Java version | |
| run: java -version | |
| - name: Configure git | |
| run: | | |
| git config --global committer.email "infra@finos.org" | |
| git config --global committer.name "FINOS Admin" | |
| git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git config --global author.name "${GITHUB_ACTOR}" | |
| - name: Download deps and plugins | |
| run: mvn de.qaware.maven:go-offline-maven-plugin:resolve-dependencies | |
| - name: Restore legend-pure snapshot | |
| if: inputs.pure_ref != '' | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: pure-m2-snapshot | |
| path: ~/.m2/repository/org/finos/legend/pure/ | |
| - name: Set pure version override | |
| id: pureVersion | |
| run: | | |
| if [ -n "${{ needs.build-pure.outputs.pure_version }}" ]; then | |
| echo "arg=-Dlegend.pure.version=${{ needs.build-pure.outputs.pure_version }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "arg=" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Collect Workflow Telemetry | |
| uses: runforesight/workflow-telemetry-action@v1 | |
| with: | |
| theme: dark | |
| - name: Set profiles that required github secrets | |
| id: requiredSecrets | |
| if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'finos/legend-engine') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| run: echo PROFILES='-P pct-cloud-test' >> $GITHUB_OUTPUT | |
| - name: Purge stale legend-engine artifacts from local Maven repo | |
| # The Maven cache restore (via restore-keys fall-through) brings in | |
| # org/finos/legend/engine/* jars accumulated by prior build/release | |
| # runs that share this cache key prefix. | |
| run: rm -rf ~/.m2/repository/org/finos/legend/engine | |
| - name: Build (PR) | |
| if: github.ref != 'refs/heads/master' | |
| env: | |
| MAVEN_OPTS: "-Xmx8g" | |
| run: | | |
| mvn -B -e -DskipTests=true install ${{ steps.pureVersion.outputs.arg }} ${{ steps.requiredSecrets.outputs.PROFILES }} | |
| - name: Build (Master + Docker Snapshot) | |
| if: github.ref == 'refs/heads/master' | |
| env: | |
| DOCKER_USERNAME: finos | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
| MAVEN_OPTS: "-Xmx8g" | |
| run: mvn -B -e -DskipTests=true install ${{ steps.pureVersion.outputs.arg }} -P docker-snapshot,pct-cloud-test | |
| - name: Upload build output | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-output | |
| path: | | |
| ~/**/target/ | |
| !~/**/target/*.jar | |
| retention-days: 1 | |
| overwrite: true | |
| include-hidden-files: true | |
| if-no-files-found: error | |
| - name: Upload m2 repository | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: m2-repo | |
| path: ~/.m2/repository/org/finos/legend/engine/ | |
| retention-days: 1 | |
| overwrite: true | |
| if-no-files-found: error | |
| - name: Purge engine artifacts before cache save | |
| # actions/cache's post-job save snapshots ~/.m2/repository at the | |
| # end of the job. We don't want the just-built engine jars in that | |
| # snapshot. | |
| if: always() | |
| run: rm -rf ~/.m2/repository/org/finos/legend/engine | |
| - name: Set Test Matrix | |
| id: testMatrix | |
| run: echo "testMatrix=$(jq -c . < .github/workflows/resources/modulesToTest.json)" >> $GITHUB_OUTPUT | |
| - name: Upload CI Event | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: event-file | |
| path: ${{ github.event_path }} | |
| test: | |
| name: Run Unit Tests | |
| runs-on: ubuntu-latest | |
| if: "!cancelled() && needs.build.result == 'success'" | |
| needs: | |
| - build | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Before Test | |
| uses: ./.github/workflows/actions/before-test | |
| - name: Restore legend-pure snapshot | |
| if: inputs.pure_ref != '' | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: pure-m2-snapshot | |
| path: ~/.m2/repository/org/finos/legend/pure/ | |
| - name: Excluded Modules | |
| id: modulesToExclude | |
| run: echo EXCLUSION_MODULES=`jq -c '.include | map(.modules) | flatten | map("!org.finos.legend.engine:" + .) | join(",")' ./.github/workflows/resources/modulesToTest.json` >> $GITHUB_OUTPUT | |
| - name: Test | |
| env: | |
| MAVEN_OPTS: "-Xmx1g" | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| run: | | |
| mvn -B -e surefire:test ${{ needs.build.outputs.pureVersionArg }} -pl ${{ steps.modulesToExclude.outputs.EXCLUSION_MODULES }} ${{ needs.build.outputs.profiles }} -T2 -DargLine="-Xmx6g" -Dsurefire.reports.directory=${GITHUB_WORKSPACE}/surefire-reports-aggregate | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-results | |
| path: ${{ github.workspace }}/surefire-reports-aggregate/*.xml | |
| test-modules: | |
| name: Test Module - ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| if: "!cancelled() && needs.build.result == 'success'" | |
| needs: | |
| - build | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{fromJson(needs.build.outputs.testMatrix)}} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Before Test | |
| uses: ./.github/workflows/actions/before-test | |
| - name: Restore legend-pure snapshot | |
| if: inputs.pure_ref != '' | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: pure-m2-snapshot | |
| path: ~/.m2/repository/org/finos/legend/pure/ | |
| - name: Included Modules | |
| id: modulesToInclude | |
| env: | |
| MODULES: ${{ toJSON(matrix.modules) }} | |
| run: | | |
| echo INCLUSION_MODULES=`jq -c 'map("org.finos.legend.engine:" + .) | join(",")' <<< $MODULES` >> $GITHUB_OUTPUT | |
| - name: Test | |
| env: | |
| MAVEN_OPTS: "-Xmx1g" | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| run: | | |
| mvn -B -e surefire:test ${{ needs.build.outputs.pureVersionArg }} -pl ${{ steps.modulesToInclude.outputs.INCLUSION_MODULES }} ${{ needs.build.outputs.profiles }} -T2 -DargLine="-Xmx6g" -Dsurefire.reports.directory=${GITHUB_WORKSPACE}/surefire-reports-aggregate | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-results-${{ matrix.name }} | |
| path: ${{ github.workspace }}/surefire-reports-aggregate/*.xml | |
| pct-report: | |
| name: PCT Report | |
| runs-on: ubuntu-latest | |
| if: "!cancelled() && needs.build.result == 'success' && needs.test.result == 'success' && needs.test-modules.result == 'success' && github.ref == 'refs/heads/master'" | |
| needs: | |
| - build | |
| - test | |
| - test-modules | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Setup | |
| uses: ./.github/workflows/actions/before-test | |
| - name: Generate PCT Report | |
| run: | | |
| mvn exec:java -pl org.finos.legend.engine:legend-engine-pure-ide-light-http-server -Dexec.mainClass="org.finos.legend.engine.server.core.pct.GeneratePCTFiles" | |
| - name: Upload PCT HTML Report | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pct-html-report | |
| path: target/ok.html | |
| - name: Checkout Legend Docs | |
| uses: actions/checkout@v6 | |
| with: | |
| path: 'legend-docs' | |
| ref: 'master' | |
| repository: 'finos/legend' | |
| token: ${{ secrets.FINOS_GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: Copy Legend Docs | |
| shell: bash | |
| run: | | |
| mkdir -p legend-docs/website/static/pct/ | |
| cp -rvT target/pct/. legend-docs/website/static/pct/ | |
| - name: Check for new documentation files | |
| id: newFiles | |
| shell: bash | |
| working-directory: legend-docs | |
| run: | | |
| git add -A | |
| git status --porcelain | wc -l | |
| if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then | |
| echo "hasNewFiles=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "hasNewFiles=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit new documentation files | |
| if: ${{ steps.newFiles.outputs.hasNewFiles == 'true' }} | |
| shell: bash | |
| working-directory: legend-docs | |
| run: | | |
| git commit -m "maint: update legend-engine docs from ref: ${{ github.sha }}" | |
| git push |