Added REST test to the CI #10778
This file contains 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: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
- trigger-ci-workflow | |
paths: | |
- "quickwit/**" | |
- "!quickwit/quickwit-ui/**" | |
env: | |
CARGO_INCREMENTAL: 0 | |
QW_DISABLE_TELEMETRY: 1 | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: -Dwarnings | |
RUSTDOCFLAGS: -Dwarnings -Arustdoc::private_intra_doc_links | |
TEST_DATABASE_URL: postgres://quickwit-dev:quickwit-dev@postgres:5432/quickwit-metastore-dev | |
# Ensures that we cancel running jobs for the same PR / same workflow. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: ${{ matrix.task.name }} (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
task: | |
- name: cargo clippy | |
command: cargo clippy --workspace --tests --all-features | |
cache: true | |
- name: cargo deny | |
command: cargo deny check licenses | |
cache: false | |
- name: cargo doc | |
command: cargo doc --no-deps --all-features --document-private-items | |
cache: true | |
- name: cargo nextest | |
command: cargo nextest run --features=postgres --profile ci --retries 1 | |
cache: true | |
# - name: REST integration tests | |
# command: make rest-test | |
# cache: true | |
- name: License headers check | |
command: bash scripts/check_license_headers.sh | |
cache: false | |
- name: rustfmt | |
command: cargo +nightly fmt --all -- --check | |
cache: false | |
# container: public.ecr.aws/l6o9a3f9/quickwit-builder:latest | |
services: | |
# PostgreSQL service container | |
postgres: | |
image: postgres:latest | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: quickwit-dev | |
POSTGRES_PASSWORD: quickwit-dev | |
POSTGRES_DB: quickwit-metastore-dev | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Ubuntu packages | |
run: sudo apt install protobuf-compiler python3 python3-pip | |
- uses: dorny/paths-filter@v2 | |
id: modified-files | |
with: | |
filters: | | |
qw-src: | |
- quickwit/** | |
ui-src: | |
- quickwit/quickwit-ui/** | |
- name: Setup nightly Rust Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt, clippy | |
- name: Setup stable Rust Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: "1.70" | |
override: true | |
components: rustfmt, clippy | |
- uses: actions-rs/[email protected] | |
with: | |
crate: cargo-deny | |
version: latest | |
- name: Setup cache | |
if: matrix.task.cache == true | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: "v1-${{ matrix.task.name }}" | |
workspaces: "./quickwit -> target" | |
- name: Install nextest | |
if: matrix.task.name == 'cargo nextest' | |
uses: taiki-e/install-action@nextest | |
- name: ${{ matrix.task.name }} | |
if: steps.modified-files.outputs.qw-src == 'true' && steps.modified-files.outputs.ui-src == 'false' | |
run: ${{ matrix.task.command }} | |
working-directory: ./quickwit |