Skip to content

ci: add semver check before publish #437

ci: add semver check before publish

ci: add semver check before publish #437

Workflow file for this run

name: CI (Linux)
on: [ push, pull_request ]
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Start ArangoDB by docker-compose
run: |
docker compose -f tests/docker-compose.yml up -d
sleep 30
docker compose -f tests/docker-compose.yml logs
- name: Set up ArangoDB for test
run: bash tests/init_db.sh
- name: rustfmt
env:
RUST_LOG: arangors=trace
run: cargo fmt --all -- --check
- name: check build (blocking)
env:
RUST_LOG: arangors=trace
run: cargo check --no-default-features --features "rocksdb cluster enterprise blocking" --lib
- name: test (blocking)
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
run: cargo test --no-fail-fast --no-default-features --features "rocksdb cluster enterprise blocking" --lib -- --test-threads=1
- name: check build (reqwest_blocking)
env:
RUST_LOG: arangors=trace
run: cargo check --no-default-features --features "rocksdb cluster enterprise reqwest_blocking" --all
- name: test (reqwest_blocking)
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
run: cargo test --no-fail-fast --no-default-features --features "rocksdb cluster enterprise reqwest_blocking" --all -- --test-threads=1
- name: check build (default features)
env:
RUST_LOG: arangors=trace
run: cargo check --all --bins --examples --tests
- name: tests (default features)
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
run: cargo test --all --no-fail-fast -- --nocapture -- --test-threads=1
- name: check build (async)
env:
RUST_LOG: arangors=trace
run: cargo check --no-default-features --features "rocksdb cluster enterprise" --lib
- name: test (async)
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
run: cargo test --no-fail-fast --no-default-features --features "rocksdb cluster enterprise" --lib -- --test-threads=1
- name: check build (reqwest_async)
env:
RUST_LOG: arangors=trace
run: cargo check --no-default-features --features "rocksdb cluster enterprise reqwest_async" --all
- name: test (reqwest_async)
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
run: cargo test --no-fail-fast --no-default-features --features "rocksdb cluster enterprise reqwest_async" --all -- --test-threads=1
- name: check build (surf_async)
env:
RUST_LOG: arangors=trace
run: cargo check --no-default-features --features "rocksdb cluster enterprise surf_async" --all
- name: test (surf_async)
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
run: cargo test --no-fail-fast --no-default-features --features "rocksdb cluster enterprise surf_async" --all -- --test-threads=1
mmfiles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Start ArangoDB by docker
run: |
docker run -e ARANGO_STORAGE_ENGINE=mmfiles -e ARANGO_ROOT_PASSWORD=KWNngteTps7XjrNv -p 8529:8529 -d --name arangodb arangodb/arangodb
sleep 30
docker logs arangodb
- name: Set up ArangoDB for test
run: bash tests/init_db.sh
- name: check build
env:
RUST_LOG: arangors=trace
run: cargo check --all --bins --examples --tests --no-default-features --features "mmfiles cluster enterprise reqwest_blocking" --lib
- name: tests
env:
RUST_LOG: arangors=trace
timeout-minutes: 40
run: cargo test --all --no-fail-fast --no-default-features --features "mmfiles cluster enterprise reqwest_blocking" -- --test-threads=1
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: doc
env:
RUSTDOCFLAGS: -Dwarnings
run: cargo doc --all --no-deps
publish:
name: Publish Package
needs: build_and_test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v1
- name: login
env:
SUPER_SECRET: ${{ secrets.CARGO_TOKEN }}
run: cargo login "$SUPER_SECRET"
shell: bash
- name: publish
run: cargo publish