Build and Test #3
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: Build and Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Increase disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| sudo docker builder prune -a | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install tree-sitter-cli | |
| run: npm install -g tree-sitter-cli | |
| - name: Install LLVM | |
| run: sudo apt-get install -y llvm | |
| - name: Install ODBC | |
| run: sudo apt-get install -y unixodbc-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Caching | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ${{ runner.os }}-build | |
| cache-on-failure: true | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Run Rust formatting check | |
| run: cargo fmt --all -- --check | |
| - name: Run Clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Install wasm-pack | |
| run: cargo install wasm-pack | |
| - name: Build with cargo | |
| run: cargo build --all-targets | |
| - name: Run tree-sitter tests | |
| working-directory: tree-sitter-ggsql | |
| run: tree-sitter test | |
| - name: Run Rust tests | |
| run: cargo test --lib --bins | |
| - name: Install dbc CLI and SQLite ADBC driver | |
| run: | | |
| curl -LsSf https://dbc.columnar.tech/install.sh | sh | |
| "$HOME/.local/bin/dbc" install sqlite | |
| - name: Run ADBC unit tests | |
| run: cargo test --features "adbc sqlite" --lib | |
| - name: Run ADBC SQLite equivalence tests | |
| run: cargo test --features "adbc sqlite" --lib -- --ignored equivalence | |
| - name: Build WASM library | |
| working-directory: ggsql-wasm/library | |
| run: npm install && npm run build | |
| - name: Build WASM package | |
| working-directory: ggsql-wasm | |
| run: wasm-pack build --target web --profile wasm --no-opt |