name: Change tests on: pull_request: branches: - main - next schedule: - cron: "12 3 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: fmt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup-rust with: component: rustfmt - run: cargo fmt -- --check clippy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: version: 1.76.0 component: clippy - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/oxsdatatypes - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/oxrdf - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/oxrdfxml - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/oxttl - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/oxrdfio - run: cargo clippy --all-targets --features async-tokio -- -D warnings -D clippy::all working-directory: ./lib/oxrdfio - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/sparesults - run: cargo clippy --all-targets --features async-tokio -- -D warnings -D clippy::all working-directory: ./lib/sparesults - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/spargebra - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/sparopt - run: cargo clippy --all-targets --no-default-features -- -D warnings -D clippy::all working-directory: ./lib/oxigraph - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./lib/oxigraph - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./python - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./cli - run: cargo clippy --all-targets -- -D warnings -D clippy::all working-directory: ./testsuite clippy_wasm_js: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: version: 1.76.0 target: wasm32-unknown-unknown component: clippy - run: cargo clippy --lib --tests --target wasm32-unknown-unknown -- -D warnings -D clippy::all working-directory: ./js clippy_wasi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: version: 1.76.0 target: wasm32-wasi component: clippy - run: cargo clippy --lib --tests --target wasm32-wasi -- -D warnings -D clippy::all working-directory: ./lib/oxigraph - run: cargo clippy --target wasm32-wasi --features abi3 --no-default-features -- -D warnings -D clippy::all working-directory: ./python clippy_wasm_emscripten: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: version: 1.76.0 target: wasm32-unknown-emscripten component: clippy - run: cargo clippy --lib --tests --target wasm32-unknown-emscripten -- -D warnings -D clippy::all working-directory: ./lib/oxigraph - run: cargo clippy --target wasm32-unknown-emscripten --features abi3 -- -D warnings -D clippy::all working-directory: ./python clippy_wasm_unknown: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: version: 1.76.0 target: wasm32-unknown-unknown component: clippy - run: cargo clippy --lib --tests --target wasm32-unknown-unknown --features getrandom/custom --features oxsdatatypes/custom-now -- -D warnings -D clippy::all working-directory: ./lib/oxigraph deny: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: taiki-e/install-action@v2 with: { tool: cargo-deny } - run: cargo deny check semver_checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust - uses: taiki-e/install-action@v2 with: { tool: cargo-semver-checks } - uses: actions/cache@v3 with: path: rocksdb key: ${{ runner.os }}-rocksdb-8.0.0 - run: bash .github/workflows/install_rocksdb.sh - run: cargo semver-checks check-release --exclude oxrocksdb-sys --exclude oxigraph-js --exclude pyoxigraph --exclude oxigraph-testsuite --exclude oxigraph-cli test_linux_x86_64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust - run: cargo test test_linux_i686: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: target: i686-unknown-linux-gnu - run: sudo apt-get update && sudo apt-get install -y g++-multilib - run: cargo test --target i686-unknown-linux-gnu --no-default-features --features http-client-rustls-native working-directory: ./lib/oxigraph test_linux_msv: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - name: Read MSRV from Cargo.toml id: metadata run: echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT - uses: ./.github/actions/setup-rust with: version: ${{ steps.metadata.outputs.rust-version }} - run: rustup toolchain install nightly - run: rm Cargo.lock && cargo +nightly update -Z direct-minimal-versions && cargo update -p bumpalo --precise 3.14.0 - run: cargo test test_linux_latest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust - run: rm Cargo.lock && cargo update - run: cargo test test_linux_address_sanitizer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: version: nightly - run: sudo apt-get update && sudo apt-get install -y llvm - run: cargo test --tests --target x86_64-unknown-linux-gnu --workspace --exclude pyoxigraph --exclude oxigraph-testsuite --exclude oxigraph-cli env: RUSTFLAGS: -Z sanitizer=address test_linux_dynamic_linking: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust - uses: actions/cache@v3 with: path: rocksdb key: ${{ runner.os }}-rocksdb-8.0.0 - run: bash .github/workflows/install_rocksdb.sh - run: cargo test --tests --features oxrocksdb-sys/pkg-config test_windows: runs-on: windows-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust - run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse - run: cargo test test_wasi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: target: wasm32-wasi - uses: taiki-e/install-action@v2 with: { tool: "wasmtime,cargo-wasi" } - run: cargo wasi test --workspace --exclude oxigraph-js --exclude oxigraph-cli --exclude oxigraph-testsuite --exclude oxrocksdb-sys --exclude pyoxigraph rustdoc: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust with: version: 1.76.0 - run: cargo doc env: RUSTDOCFLAGS: -D warnings js: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup-rust - uses: taiki-e/install-action@v2 with: { tool: wasm-pack } - uses: actions/setup-node@v3 with: node-version: 18 cache: npm cache-dependency-path: "js/package.json" - run: npm install working-directory: ./js - run: npm test working-directory: ./js python: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust - uses: actions/setup-python@v4 with: python-version: "3.12" cache: pip cache-dependency-path: '**/requirements.dev.txt' - run: pip install -r python/requirements.dev.txt - run: maturin build -m python/Cargo.toml - run: pip install --no-index --find-links=target/wheels/ pyoxigraph - run: rm -r target/wheels - run: python -m unittest working-directory: ./python/tests - run: sphinx-build -M html . build working-directory: ./python/docs - run: python generate_stubs.py pyoxigraph pyoxigraph.pyi --ruff working-directory: ./python - run: python -m mypy.stubtest pyoxigraph --allowlist=mypy_allowlist.txt working-directory: ./python - run: python -m mypy generate_stubs.py tests --strict working-directory: ./python - run: python -m ruff format --check . working-directory: ./python - run: python -m ruff check --output-format=github . working-directory: ./python - run: sphinx-lint docs working-directory: ./python python_msv: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - name: Read MSRV from Cargo.toml id: metadata run: echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT - uses: ./.github/actions/setup-rust with: version: ${{ steps.metadata.outputs.rust-version }} - run: rustup toolchain install nightly - uses: actions/setup-python@v4 with: python-version: "3.8" cache: pip cache-dependency-path: '**/requirements.dev.txt' - run: pip install -r python/requirements.dev.txt - run: rm Cargo.lock && cargo +nightly update -Z direct-minimal-versions - run: maturin build -m python/Cargo.toml - run: pip install --no-index --find-links=target/wheels/ pyoxigraph - run: rm -r target/wheels - run: python -m unittest working-directory: ./python/tests python_pypy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust - uses: actions/setup-python@v4 with: python-version: "pypy3.10" cache: pip cache-dependency-path: '**/requirements.dev.txt' - run: pip install -r python/requirements.dev.txt - run: maturin build -m python/Cargo.toml - run: pip install --no-index --find-links=target/wheels/ pyoxigraph - run: rm -r target/wheels - run: python -m unittest working-directory: ./python/tests python_windows: runs-on: windows-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: ./.github/actions/setup-rust - uses: actions/setup-python@v4 with: python-version: "3.12" cache: pip cache-dependency-path: '**/requirements.dev.txt' - run: pip install "maturin~=1.0" - run: maturin build -m python/Cargo.toml - run: pip install --no-index --find-links=target/wheels/ pyoxigraph - run: rm -r target/wheels - run: python -m unittest working-directory: ./python/tests python_pyodide: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: true - uses: actions/setup-python@v4 with: python-version: "3.11" cache: pip cache-dependency-path: '**/requirements.dev.txt' - uses: ./.github/actions/setup-rust with: version: nightly target: wasm32-unknown-emscripten - run: | pip install pyodide-build echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV - uses: mymindstorm/setup-emsdk@v13 with: version: ${{ env.EMSCRIPTEN_VERSION }} - run: pyodide build working-directory: ./python - run: | pyodide venv venv source venv/bin/activate pip install --no-index --find-links=../dist/ pyoxigraph python -m unittest working-directory: ./python/tests typos: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: taiki-e/install-action@v2 with: { tool: typos-cli } - run: typos clang_fmt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: sudo apt-get update && sudo apt-get install -y clang-format - run: clang-format --Werror --dry-run oxrocksdb-sys/api/* fuzz_changes: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - uses: google/clusterfuzzlite/actions/build_fuzzers@v1 with: language: rust github-token: ${{ secrets.GITHUB_TOKEN }} sanitizer: address storage-repo: https://${{ secrets.FULL_ACCESS_TOKEN }}@github.com/oxigraph/clusterfuzzlite-oxigraph.git - uses: google/clusterfuzzlite/actions/run_fuzzers@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} fuzz-seconds: 900 mode: code-change sanitizer: address minimize-crashes: true parallel-fuzzing: true storage-repo: https://${{ secrets.FULL_ACCESS_TOKEN }}@github.com/oxigraph/clusterfuzzlite-oxigraph.git fuzz_repo: if: github.event_name != 'pull_request' runs-on: ubuntu-latest steps: - uses: google/clusterfuzzlite/actions/build_fuzzers@v1 with: language: rust github-token: ${{ secrets.GITHUB_TOKEN }} sanitizer: address - uses: google/clusterfuzzlite/actions/run_fuzzers@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} fuzz-seconds: 7200 mode: batch sanitizer: address minimize-crashes: true parallel-fuzzing: true storage-repo: https://${{ secrets.FULL_ACCESS_TOKEN }}@github.com/oxigraph/clusterfuzzlite-oxigraph.git continue-on-error: true - uses: google/clusterfuzzlite/actions/run_fuzzers@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} fuzz-seconds: 3600 mode: prune storage-repo: https://${{ secrets.FULL_ACCESS_TOKEN }}@github.com/oxigraph/clusterfuzzlite-oxigraph.git continue-on-error: true fuzz_coverage: if: github.event_name != 'pull_request' needs: fuzz_repo runs-on: ubuntu-latest steps: - uses: google/clusterfuzzlite/actions/build_fuzzers@v1 with: language: rust sanitizer: coverage - uses: google/clusterfuzzlite/actions/run_fuzzers@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} fuzz-seconds: 3600 mode: coverage sanitizer: coverage storage-repo: https://${{ secrets.FULL_ACCESS_TOKEN }}@github.com/oxigraph/clusterfuzzlite-oxigraph.git shellcheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: sudo apt-get update && sudo apt-get install -y shellcheck - run: git grep -l '^#\( *shellcheck \|!\(/bin/\|/usr/bin/env \)\(sh\|bash\|dash\|ksh\)\)' | xargs shellcheck spec_links: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: python lints/test_spec_links.py debian_compatibility: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup-rust - run: python lints/test_debian_compatibility.py codspeed: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: submodules: true - uses: ./.github/actions/setup-rust - uses: taiki-e/install-action@v2 with: { tool: cargo-codspeed } - run: cargo codspeed build -p oxigraph --features http-client-native-tls - run: cargo codspeed build -p oxigraph-testsuite - uses: CodSpeedHQ/action@v2 with: run: cargo codspeed run token: ${{ secrets.CODSPEED_TOKEN }} codecov: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: submodules: true - uses: ./.github/actions/setup-rust - uses: taiki-e/install-action@v2 with: { tool: cargo-llvm-cov } - run: cargo llvm-cov --codecov --output-path codecov.json - uses: codecov/codecov-action@v3 with: files: codecov.json flags: rust fail_ci_if_error: true