surrealpatch/.github/workflows/ci.yml

650 lines
15 KiB
YAML
Raw Normal View History

name: Continuous integration
run-name: "CI run '${{ github.head_ref || github.ref_name }}'"
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
merge_group:
defaults:
run:
shell: bash
jobs:
format:
name: Check format
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Check format
2023-09-06 13:51:33 +00:00
run: cargo make ci-format
check:
name: Check workspace
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
2022-07-13 09:28:08 +00:00
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Check workspace
2023-09-06 13:51:33 +00:00
run: cargo make ci-check
2024-04-04 07:30:13 +00:00
check-fuzzing:
name: Check fuzzing
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check fuzzers
run: cargo build --manifest-path lib/fuzz/Cargo.toml
- name: Check OSS-Fuzz
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: surrealdb
language: rust
# Temporarily allow this step to fail
continue-on-error: true
check-wasm:
name: Check Wasm
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Check wasm
2023-09-06 13:51:33 +00:00
run: cargo make ci-check-wasm
clippy:
name: Check clippy
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Run clippy
2023-09-06 13:51:33 +00:00
run: cargo make ci-clippy
cli:
name: CLI integration tests
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Run CLI integration tests
2023-09-06 13:51:33 +00:00
run: cargo make ci-cli-integration
- name: Debug info
if: always()
run: |
set -x
free -m
df -h
ps auxf
cat /tmp/surrealdb.log || true
http-server:
name: HTTP integration tests
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Run HTTP integration tests
2023-09-06 13:51:33 +00:00
run: cargo make ci-http-integration
ml-support:
name: ML integration tests
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Checkout sources
2024-03-18 09:29:19 +00:00
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Run ML integration tests
run: cargo make ci-ml-integration
ws-server:
name: WebSocket integration tests
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Run WS integration tests
2023-09-06 13:51:33 +00:00
run: cargo make ci-ws-integration
test:
name: Test workspace
runs-on: ["self-hosted", "arm64", "builder"]
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test workspace + coverage
2023-09-06 13:51:33 +00:00
run: cargo make ci-workspace-coverage
env:
CARGO_BUILD_JOBS: 4
2023-06-23 19:21:02 +00:00
- name: Upload coverage report
2024-03-18 09:29:19 +00:00
uses: actions/upload-artifact@v4
timeout-minutes: 1
continue-on-error: true
2023-06-23 19:21:02 +00:00
with:
name: code-coverage-report
path: target/llvm-cov/html/
retention-days: 5
2024-05-24 17:56:14 +00:00
test-sdk-build:
name: Test SDK build
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Build local
working-directory: tests/sdk/local
run: cargo build
- name: Build remote
working-directory: tests/sdk/remote
run: cargo build
ws-engine:
name: WebSocket engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install dependencies
run: |
sudo apt-get -y update
2022-07-13 09:28:08 +00:00
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test ws engine
2023-09-06 13:51:33 +00:00
run: cargo make ci-api-integration-ws
- name: Debug info
if: always()
run: |
set -x
free -m
df -h
ps auxf
cat /tmp/surrealdb.log || true
http-engine:
name: HTTP engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
2022-07-13 09:28:08 +00:00
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test http engine
2023-09-06 13:51:33 +00:00
run: cargo make ci-api-integration-http
- name: Debug info
if: always()
run: |
set -x
free -m
df -h
ps auxf
cat /tmp/surrealdb.log || true
any-engine:
name: Any engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test any engine
2023-09-06 13:51:33 +00:00
run: cargo make ci-api-integration-any
- name: Debug info
if: always()
run: |
set -x
free -m
df -h
ps auxf
cat /tmp/surrealdb.log || true
mem-engine:
name: Memory engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
2022-07-13 09:28:08 +00:00
- name: Checkout sources
uses: actions/checkout@v4
2022-07-13 09:28:08 +00:00
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test mem engine
2023-09-06 13:51:33 +00:00
run: cargo make ci-api-integration-mem
2022-07-13 09:28:08 +00:00
file-engine:
name: File engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test file engine
2023-09-06 13:51:33 +00:00
run: cargo make ci-api-integration-file
rocksdb-engine:
name: RocksDB engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test rocksdb engine
2023-09-06 13:51:33 +00:00
run: cargo make ci-api-integration-rocksdb
tikv-engine:
name: TiKV engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install TiUP
timeout-minutes: 10
run: |
while ! ~/.tiup/bin/tiup -v; do
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
done
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test tikv engine
2023-09-06 13:51:33 +00:00
run: cargo make ci-api-integration-tikv
- name: Debug info
if: always()
run: |
set -x
free -m
df -h
ps auxf
cat /tmp/surrealdb.log || true
2023-06-13 20:55:38 +00:00
fdb-engine:
name: FoundationDB engine
runs-on: ubuntu-latest
2023-06-13 20:55:38 +00:00
steps:
- name: Install stable toolchain
2023-09-06 13:51:33 +00:00
uses: dtolnay/rust-toolchain@stable
2023-08-24 16:33:57 +00:00
with:
toolchain: stable
2023-06-13 20:55:38 +00:00
- name: Checkout sources
uses: actions/checkout@v4
2023-06-13 20:55:38 +00:00
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
2023-06-23 11:58:15 +00:00
2023-06-13 20:55:38 +00:00
- name: Setup FoundationDB
uses: foundationdb-rs/foundationdb-actions-install@v.2.2.0
2023-06-13 20:55:38 +00:00
with:
version: "7.1.30"
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
2023-06-13 20:55:38 +00:00
- name: Test fdb engine
2023-09-06 13:51:33 +00:00
run: cargo make ci-api-integration-fdb
- name: Debug info
if: always()
run: |
set -x
free -m
df -h
ps auxf
cat /tmp/surrealdb.log || true
surrealkv-engine:
name: SurrealKV engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test surrealkv engine
run: cargo make ci-api-integration-surrealkv
- name: Debug info
if: always()
run: |
set -x
free -m
df -h
ps auxf
cat /tmp/surrealdb.log || true
db-upgrade:
name: Database Upgrade from previous versions
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Test upgrade
2024-04-05 10:32:27 +00:00
# Allow breaking changes until v2 stabilises
continue-on-error: true
run: cargo make ci-database-upgrade