test: add cjson and simdjson fixture coverage #76
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: CI | |
| on: | |
| push: | |
| branches: [master, main] | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| rust: | |
| name: Rust tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust (stable) | |
| run: | | |
| rustup toolchain install stable --profile minimal --no-self-update | |
| rustup default stable | |
| - name: Cache cargo registry & target | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.toml') }} | |
| restore-keys: | | |
| cargo-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Build (release) | |
| run: cargo build --release | |
| - name: Test (release) | |
| run: cargo test --release | |
| - name: Test scalar-only (no AVX2/NEON feature) | |
| run: cargo test --release --no-default-features | |
| - name: Test with test-panic feature | |
| run: cargo test --features test-panic --release | |
| lua: | |
| name: Lua integration tests | |
| runs-on: ubuntu-latest | |
| needs: rust | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust (stable) | |
| run: | | |
| rustup toolchain install stable --profile minimal --no-self-update | |
| rustup default stable | |
| - name: Cache cargo registry & target | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.toml') }} | |
| restore-keys: | | |
| cargo-${{ runner.os }}- | |
| - name: Build cdylib | |
| run: cargo build --release | |
| - name: Install LuaJIT, LuaRocks and dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y luajit lua5.1 liblua5.1-0-dev luarocks | |
| # luarocks on Ubuntu targets lua5.1 by default; LuaJIT is ABI-compatible | |
| # with 5.1 so rocks built for 5.1 load fine under luajit. | |
| sudo luarocks install busted | |
| sudo luarocks install lua-cjson | |
| - name: Run busted tests (under LuaJIT) | |
| run: | | |
| # ffi.load("qjson") uses dlopen which respects LD_LIBRARY_PATH, | |
| # not LuaJIT's package.cpath. Point dlopen at the release build dir. | |
| LD_LIBRARY_PATH="$PWD/target/release" \ | |
| busted --lua=$(which luajit) tests/lua \ | |
| --lpath='./lua/?.lua' |