Skip to content

Stop relying on builder image for CI. #10811

Stop relying on builder image for CI.

Stop relying on builder image for CI. #10811

Workflow file for this run

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: Unit tests
runs-on: "ubuntu-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-get -y update -y && sudo apt-get -y install protobuf-compiler python3 python3-pip \
build-essential \
ca-certificates \
cmake \
curl \
git \
htop \
jq \
libasound2 \
libclang-dev \
libgbm-dev \
libgconf-2-4 \
libgtk-3-0 \
libgtk2.0-0 \
libnotify-dev \
libnss3 \
libpq-dev \
libpq5 \
libssl-dev \
libxss1 \
libxtst6 \
pkg-config \
procps \
wget \
xauth \
xvfb
- uses: dorny/paths-filter@v2
id: modified-files
with:
filters: |
qw-src:
- quickwit/**
ui-src:
- quickwit/quickwit-ui/**
# The following step is just meant to install rustup actually.
# The next one installs the correct toolchain.
- name: Install rustup
uses: actions-rs/toolchain@v1
with:
toolchain: 1.70
components: ""
- name: Setup stable Rust Toolchain
run: rustup show
working-directory: ./quickwit
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
key: "v1-${{ matrix.task.name }}"
workspaces: "./quickwit -> target"
- name: Install nextest
uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-nextest
- name: cargo nextest
if: always()
run: cargo nextest run --features=postgres --profile ci --retries 1
working-directory: ./quickwit
lints:
name: Lints
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Install Ubuntu packages
run: sudo apt-get -y update && sudo apt-get -y 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 (for rustfmt)
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
- name: Setup stable Rust Toolchain
run: rustup show
working-directory: ./quickwit
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
key: "v1-${{ matrix.task.name }}"
workspaces: "./quickwit -> target"
- name: Install cargo deny
uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-deny
- name: cargo clippy
if: always()
run: cargo clippy --workspace --tests --all-features
working-directory: ./quickwit
- name: cargo deny
if: always()
run: cargo deny check licenses
working-directory: ./quickwit
- name: cargo doc
if: always()
run: cargo doc
working-directory: ./quickwit
- name: License headers check
if: always()
run: bash scripts/check_license_headers.sh
working-directory: ./quickwit
- name: rustfmt
if: always()
run: cargo +nightly fmt --all -- --check
working-directory: ./quickwit