Add Phase 1 SQL support with DataFusion and Substrait #4531
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
| name: CI | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| env: | |
| TURBO_TELEMETRY_DISABLED: 1 | |
| jobs: | |
| build-cli: | |
| name: Build compiler | |
| strategy: | |
| matrix: | |
| target: | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-latest | |
| build-name: isograph_cli | |
| artifact-name: isograph_cli-bin-linux-arm64 | |
| cross: true | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| build-name: isograph_cli | |
| artifact-name: isograph_cli-macos-x64 | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| build-name: isograph_cli | |
| artifact-name: isograph_cli-macos-arm64 | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| longpaths: true | |
| build-name: isograph_cli.exe | |
| artifact-name: isograph_cli-bin-win-x64 | |
| uses: ./.github/workflows/build-cli.yml | |
| with: | |
| target: ${{ matrix.target.target }} | |
| os: ${{ matrix.target.os }} | |
| build-name: ${{ matrix.target.build-name }} | |
| artifact-name: ${{ matrix.target.artifact-name }} | |
| longpaths: ${{ matrix.target.longpaths || false }} | |
| cross: ${{ matrix.target.cross || false }} | |
| musl: ${{ matrix.target.musl || false }} | |
| build-cli-linux: | |
| name: Build compiler (x86_64-unknown-linux-musl) | |
| uses: ./.github/workflows/build-cli.yml | |
| with: | |
| target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| build-name: isograph_cli | |
| artifact-name: isograph_cli-linux-x64 | |
| musl: true | |
| build-demos: | |
| name: Build demos | |
| runs-on: ubuntu-latest | |
| needs: [build-cli-linux] | |
| strategy: | |
| matrix: | |
| target: | |
| - folder: demos/github-demo | |
| - folder: demos/pet-demo | |
| - folder: demos/vite-demo | |
| - folder: libs/isograph-react | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: 'Download cli binary' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-linux-x64 | |
| path: artifacts/linux-x64 | |
| - name: Make artifact executable | |
| run: chmod +x ./artifacts/linux-x64/isograph_cli | |
| - name: 'Build project' | |
| run: cd ./${{ matrix.target.folder }} && ../../artifacts/linux-x64/isograph_cli --config ./isograph.config.json | |
| - name: 'Check working directory status' | |
| run: './scripts/check-git-status.sh' | |
| build-json-schema: | |
| name: Build json schema | |
| uses: ./.github/workflows/run-cargo-bin-and-ensure-no-changes.yml | |
| with: | |
| binary: build_json_schema | |
| typecheck-demos: | |
| name: Typecheck and Lint Demos | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: | |
| - folder: github-demo | |
| - folder: pet-demo | |
| - folder: vite-demo | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - uses: pnpm/action-setup@v2 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Build JS files | |
| run: pnpm compile-libs | |
| - name: Typecheck | |
| run: cd ./demos/${{ matrix.target.folder }} && pnpm tsc | |
| - name: Lint | |
| run: cd ./demos/${{ matrix.target.folder }} && pnpm lint | |
| build-js-packages: | |
| name: Build js packages | |
| runs-on: ubuntu-latest | |
| needs: [build-swc] | |
| timeout-minutes: 15 # in case unit test goes into infinite loop | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - uses: pnpm/action-setup@v2 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| # this used to be --frozen-lockfile --ignore-scripts | |
| # see pnpm-workspace.yaml's onlyBuildDependencies key to see which packages need scripts | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm compile-libs | |
| - name: Run unit tests | |
| # Note: unit tests have to run after building, because the unit tests | |
| # rely on Isograph, which relies on @isograph/react being a valid input | |
| # | |
| # This can be overcome, if necessary, e.g. if "@isograph/react" was a | |
| # parameter passed to the CLI. | |
| run: pnpm test | |
| build-website: | |
| name: Build website | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./docs-website | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: pnpm/action-setup@v2 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Build website | |
| run: pnpm build | |
| - name: Upload artifact | |
| id: upload-artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docusaurus-build | |
| # upload-artifact ignores working-directory, seemingly, though | |
| # the docs indicate otherwise. | |
| path: docs-website/build/ | |
| retention-days: 1 | |
| if-no-files-found: error | |
| prettier: | |
| name: Run prettier | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: pnpm/action-setup@v2 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Run prettier | |
| run: pnpm run format-prettier | |
| - name: 'Check working directory status' | |
| run: './scripts/check-git-status.sh' | |
| lint: | |
| name: Run lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: pnpm/action-setup@v2 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Run lint | |
| run: pnpm run lint --deny-warnings | |
| cargo-fmt: | |
| name: cargo fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - name: Run cargo fmt | |
| run: cargo fmt | |
| - name: 'Check working directory status' | |
| run: './scripts/check-git-status.sh' | |
| cargo-clippy: | |
| name: cargo clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| - name: Install protoc | |
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - name: Run cargo clippy | |
| run: cargo clippy | |
| cargo-test: | |
| name: Run cargo test (excluding relay tests) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - name: Install protoc | |
| run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
| - name: Run cargo test | |
| run: cargo test | |
| build-fixtures: | |
| name: Build fixtures | |
| uses: ./.github/workflows/run-cargo-bin-and-ensure-no-changes.yml | |
| with: | |
| binary: generate_isograph_fixtures | |
| params: --dir ./crates/isograph_lang_parser/fixtures/ | |
| build-swc: | |
| name: Build swc | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: wasm32-wasip1 | |
| toolchain: stable | |
| components: rustfmt | |
| - uses: awalsh128/cache-apt-pkgs-action@v1 | |
| with: | |
| packages: musl-tools # provides musl-gcc | |
| version: 1.0 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org/ | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Build swc | |
| run: pnpm build-swc | |
| all-checks-passed: | |
| name: All checks passed | |
| runs-on: ubuntu-latest | |
| needs: | |
| [ | |
| build-fixtures, | |
| build-js-packages, | |
| build-cli, | |
| build-cli-linux, | |
| build-json-schema, | |
| build-demos, | |
| build-website, | |
| prettier, | |
| cargo-fmt, | |
| cargo-clippy, | |
| cargo-test, | |
| typecheck-demos, | |
| build-swc, | |
| ] | |
| steps: | |
| - name: Do nothing | |
| run: echo Isograph is awesome! | |
| deploy-website: | |
| name: Deploy website | |
| runs-on: ubuntu-latest | |
| needs: [all-checks-passed] | |
| if: github.event_name == 'push' && github.repository == 'isographlabs/isograph' && github.ref == 'refs/heads/main' || github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | |
| defaults: | |
| run: | |
| working-directory: ./docs-website | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: pnpm/action-setup@v2 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: 'Download build folder' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docusaurus-build | |
| path: docs-website/build | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload custom | |
| run: tar --dereference --hard-dereference --directory "build" -cvf "$RUNNER_TEMP/artifact.tar" --exclude=.git --exclude =.github . | |
| - name: Upload artifact | |
| id: upload-artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: github-pages | |
| path: ${{ runner.temp }}/artifact.tar | |
| retention-days: 1 | |
| if-no-files-found: error | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| main-release: | |
| name: Main NPM release | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event_name == 'push' && | |
| github.repository == 'isographlabs/isograph' && | |
| ( | |
| (github.ref == 'refs/heads/main' && | |
| github.ref_type != 'tag') || | |
| startsWith(github.ref, 'refs/heads/deploy/') | |
| ) | |
| needs: [all-checks-passed] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - uses: pnpm/action-setup@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org/ | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Change package versions to commit | |
| run: pnpm gulp setMainVersion | |
| env: | |
| RELEASE_COMMIT_SHA: ${{ github.sha }} | |
| - name: Re-install dependencies without frozen lockfile | |
| # This is required because pnpm tries to re-install dependencies due to `verify-deps-before-run = install`, | |
| # and in CI, this is always done with --frozen-lockfile. | |
| run: pnpm install --no-frozen-lockfile --ignore-scripts | |
| # TODO do not rebuild the libs | |
| - name: Build | |
| run: pnpm compile-libs | |
| - name: Download artifact isograph_cli-linux-x64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-linux-x64 | |
| path: libs/isograph-compiler/artifacts/linux-x64 | |
| - name: Download artifact isograph_cli-bin-linux-arm64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-bin-linux-arm64 | |
| path: libs/isograph-compiler/artifacts/linux-arm64 | |
| - name: Download artifact isograph_cli-macos-x64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-macos-x64 | |
| path: libs/isograph-compiler/artifacts/macos-x64 | |
| - name: Download artifact isograph_cli-macos-arm64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-macos-arm64 | |
| path: libs/isograph-compiler/artifacts/macos-arm64 | |
| - name: Download artifact isograph_cli-bin-win-x64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-bin-win-x64 | |
| path: libs/isograph-compiler/artifacts/win-x64 | |
| - name: Mark binaries as executable | |
| run: | | |
| chmod +x libs/isograph-compiler/artifacts/linux-x64/isograph_cli | |
| chmod +x libs/isograph-compiler/artifacts/linux-arm64/isograph_cli | |
| chmod +x libs/isograph-compiler/artifacts/macos-x64/isograph_cli | |
| chmod +x libs/isograph-compiler/artifacts/macos-arm64/isograph_cli | |
| chmod +x libs/isograph-compiler/artifacts/win-x64/isograph_cli.exe | |
| # TODO do not rebuild the swc plugin | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: wasm32-wasip1 | |
| toolchain: stable | |
| components: rustfmt | |
| - uses: awalsh128/cache-apt-pkgs-action@v1 | |
| with: | |
| packages: musl-tools # provides musl-gcc | |
| version: 1.0 | |
| - name: Build swc | |
| run: pnpm build-swc | |
| - name: Publish to NPM | |
| run: pnpm --filter='./libs/*' publish --no-git-checks --tag ${{ startsWith(github.ref, 'refs/heads/deploy/') && 'deploy' || 'main' }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
| versioned-release: | |
| name: Versioned NPM release | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.repository == 'isographlabs/isograph' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | |
| needs: [all-checks-passed] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Cache turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo- | |
| - uses: pnpm/action-setup@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: https://registry.npmjs.org/ | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| # - name: Change package versions to commit | |
| # run: pnpm gulp setMainVersion | |
| # # TODO do this less hackily | |
| # TODO do not rebuild the libs | |
| - name: Build | |
| run: pnpm compile-libs | |
| - name: Download artifact isograph_cli-linux-x64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-linux-x64 | |
| path: libs/isograph-compiler/artifacts/linux-x64 | |
| - name: Download artifact isograph_cli-bin-linux-arm64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-bin-linux-arm64 | |
| path: libs/isograph-compiler/artifacts/linux-arm64 | |
| - name: Download artifact isograph_cli-macos-x64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-macos-x64 | |
| path: libs/isograph-compiler/artifacts/macos-x64 | |
| - name: Download artifact isograph_cli-macos-arm64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-macos-arm64 | |
| path: libs/isograph-compiler/artifacts/macos-arm64 | |
| - name: Download artifact isograph_cli-bin-win-x64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: isograph_cli-bin-win-x64 | |
| path: libs/isograph-compiler/artifacts/win-x64 | |
| - name: Mark binaries as executable | |
| run: | | |
| chmod +x libs/isograph-compiler/artifacts/linux-x64/isograph_cli | |
| chmod +x libs/isograph-compiler/artifacts/linux-arm64/isograph_cli | |
| chmod +x libs/isograph-compiler/artifacts/macos-x64/isograph_cli | |
| chmod +x libs/isograph-compiler/artifacts/macos-arm64/isograph_cli | |
| chmod +x libs/isograph-compiler/artifacts/win-x64/isograph_cli.exe | |
| # TODO do not rebuild the swc plugin | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: wasm32-wasip1 | |
| toolchain: stable | |
| components: rustfmt | |
| - uses: awalsh128/cache-apt-pkgs-action@v1 | |
| with: | |
| packages: musl-tools # provides musl-gcc | |
| version: 1.0 | |
| - name: Build swc | |
| run: pnpm build-swc | |
| - name: Publish latest version to NPM | |
| run: pnpm --filter './libs/*' publish --no-git-checks --tag latest | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
| publish-isograph-extension: | |
| name: Publish Isograph Extension | |
| if: github.event_name == 'push' && github.repository == 'isographlabs/isograph' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | |
| uses: ./.github/workflows/publish-isograph-extension.yml | |
| needs: [all-checks-passed] | |
| secrets: | |
| vs-marketplace-token: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
| open-vsx-token: ${{ secrets.OPEN_VSX_TOKEN }} |