surrealpatch/.github/workflows/ci.yml

542 lines
12 KiB
YAML
Raw Normal View History

name: Continuous integration
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
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Check format
uses: actions-rs/cargo@v1
with:
command: make
args: ci-format
check:
name: Check workspace
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2022-07-13 09:28:08 +00:00
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Check workspace
uses: actions-rs/cargo@v1
with:
command: make
args: ci-check
check-wasm:
name: Check Wasm
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Check wasm
uses: actions-rs/cargo@v1
with:
command: make
args: ci-check-wasm
clippy:
name: Check clippy
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: make
args: ci-clippy
cli:
name: CLI integration tests
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Run CLI integration tests
uses: actions-rs/cargo@v1
with:
command: make
args: ci-cli-integration
http-server:
name: HTTP integration tests
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Run HTTP integration tests
uses: actions-rs/cargo@v1
with:
command: make
args: ci-http-integration
ws-server:
name: WebSocket integration tests
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install protobuf-compiler libprotobuf-dev
- name: Run cargo test
run: cargo test --locked --no-default-features --features storage-mem --workspace --test ws_integration
test:
name: Test workspace
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Free up some disk space
run: |
(set -x; df -h)
# Free up some disk space by removing unused files
(set -x; sudo rm -rf /imagegeneration || true)
(set -x; sudo rm -rf /opt/az || true)
(set -x; sudo rm -rf /opt/hostedtoolcache || true)
(set -x; sudo rm -rf /opt/google || true)
(set -x; sudo rm -rf /opt/pipx || true)
(set -x; df -h)
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test workspace + coverage
uses: actions-rs/cargo@v1
with:
command: make
args: ci-workspace-coverage
2023-06-23 19:21:02 +00:00
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: target/llvm-cov/html/
retention-days: 5
ws-engine:
name: WebSocket engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
2022-07-13 09:28:08 +00:00
2023-06-13 20:55:38 +00:00
- name: Setup FoundationDB
uses: foundationdb-rs/foundationdb-actions-install@v2.0.0
with:
version: "7.1.30"
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test ws engine
uses: actions-rs/cargo@v1
with:
command: make
args: ci-api-integration-ws
http-engine:
name: HTTP engine
runs-on: ubuntu-latest
steps:
2022-07-13 09:28:08 +00:00
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2022-07-13 09:28:08 +00:00
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
2023-06-13 20:55:38 +00:00
- name: Setup FoundationDB
uses: foundationdb-rs/foundationdb-actions-install@v2.0.0
with:
version: "7.1.30"
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test http engine
uses: actions-rs/cargo@v1
with:
command: make
args: ci-api-integration-http
any-engine:
name: Any engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Setup FoundationDB
uses: foundationdb-rs/foundationdb-actions-install@v2.0.0
with:
version: "7.1.30"
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test any engine
uses: actions-rs/cargo@v1
with:
command: make
args: ci-api-integration-any
mem-engine:
name: Memory engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
2022-07-13 09:28:08 +00:00
- name: Checkout sources
uses: actions/checkout@v3
2022-07-13 09:28:08 +00:00
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test mem engine
uses: actions-rs/cargo@v1
with:
command: make
args: 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
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test file engine
uses: actions-rs/cargo@v1
with:
command: make
args: ci-api-integration-file
rocksdb-engine:
name: RocksDB engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test rocksdb engine
uses: actions-rs/cargo@v1
with:
command: make
args: ci-api-integration-rocksdb
speedb-engine:
name: SpeeDB engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test speedb engine
uses: actions-rs/cargo@v1
with:
command: make
args: ci-api-integration-speedb
tikv-engine:
name: TiKV engine
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install TiUP
run: |
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
~/.tiup/bin/tiup -v
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Test tikv engine
uses: actions-rs/cargo@v1
with:
command: make
args: ci-api-integration-tikv
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
uses: dtolnay/rust-toolchain@stable
- name: Checkout sources
uses: actions/checkout@v3
2023-06-23 11:58:15 +00:00
- name: Setup cache
uses: Swatinem/rust-cache@v2
2023-06-13 20:55:38 +00:00
- name: Setup FoundationDB
uses: foundationdb-rs/foundationdb-actions-install@v2.0.0
with:
version: "7.1.30"
- name: Install cargo-make
uses: actions-rs/cargo@v1
2023-06-13 20:55:38 +00:00
with:
command: install
args: --debug cargo-make
2023-06-13 20:55:38 +00:00
- name: Test fdb engine
uses: actions-rs/cargo@v1
with:
command: make
args: ci-api-integration-fdb