ci: enhance extensions test workflow #3795
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
| name: Extensions Tests | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| merge_group: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| PROTOC_VERSION: 3.23.4 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-libsql: | |
| runs-on: ubuntu-latest | |
| name: Build libsql (shared) | |
| steps: | |
| - uses: hecrj/setup-rust-action@v2 | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: build libsql | |
| working-directory: libsql-sqlite3 | |
| run: | | |
| ./configure | |
| make libsql | |
| - name: build bundled sqlite for ffi | |
| run: | | |
| cargo xtask build-bundled | |
| - name: upload shared build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: libsql-build-output | |
| path: | | |
| libsql-sqlite3/sqlite3.c | |
| libsql-sqlite3/sqlite3.h | |
| libsql-sqlite3/sqlite3ext.h | |
| libsql-ffi/bundled/src/sqlite3.c | |
| libsql-ffi/bundled/src/sqlite3.h | |
| libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.c | |
| libsql-ffi/bundled/SQLite3MultipleCiphers/src/sqlite3.h | |
| c-tests: | |
| needs: build-libsql | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: libsql-sqlite3 | |
| name: CR SQLite C Tests | |
| steps: | |
| - uses: hecrj/setup-rust-action@v2 | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: download shared build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libsql-build-output | |
| path: . | |
| - name: build | |
| run: | | |
| cd ext/crr | |
| make loadable | |
| - name: test | |
| run: | | |
| cd ext/crr | |
| make test | |
| rs-tests: | |
| needs: build-libsql | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: libsql-sqlite3 | |
| name: CR SQLite Rust Tests | |
| steps: | |
| - uses: hecrj/setup-rust-action@v2 | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: download shared build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libsql-build-output | |
| path: . | |
| - name: test | |
| run: | | |
| cd ext/crr/rs/core | |
| cargo test --features=loadable_extension | |
| extensions-tests: | |
| needs: build-libsql | |
| runs-on: ubuntu-latest | |
| name: Extensions Tests | |
| steps: | |
| - uses: hecrj/setup-rust-action@v2 | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: download shared build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: libsql-build-output | |
| path: . | |
| - name: install libs | |
| run: | | |
| sudo apt update | |
| sudo apt install -y libblas-dev liblapack-dev | |
| - name: download extensions | |
| run: | | |
| cd libsql-sqlite3/test/rust_suite | |
| export VSS_VERSION="v0.1.2" | |
| wget https://github.com/asg017/sqlite-vss/releases/download/$VSS_VERSION/sqlite-vss-$VSS_VERSION-loadable-linux-x86_64.tar.gz | |
| tar -xvf sqlite-vss-$VSS_VERSION-loadable-linux-x86_64.tar.gz -C src | |
| - name: test | |
| run: | | |
| cd libsql-sqlite3/test/rust_suite | |
| # Only execute extensions tests | |
| cargo test --features=extensions extensions | |
| cross-platform-build-checks: | |
| name: Cross-platform build checks | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, windows-latest] | |
| steps: | |
| - uses: hecrj/setup-rust-action@v2 | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: setup msys2 for windows | |
| if: matrix.os == 'windows-latest' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| update: true | |
| install: mingw-w64-x86_64-toolchain make base-devel | |
| msystem: mingw64 | |
| path-type: inherit | |
| - name: build libsql on windows | |
| if: matrix.os == 'windows-latest' | |
| shell: msys2 {0} | |
| working-directory: libsql-sqlite3 | |
| run: | | |
| sed -i 's/\r$//' configure VERSION | |
| ./configure | |
| make liblibsql.la | |
| - name: build libsql on macos | |
| if: matrix.os == 'macos-latest' | |
| working-directory: libsql-sqlite3 | |
| run: | | |
| ./configure | |
| make libsql |