Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop relying on builder image for CI. #3674

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 70 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
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
TEST_DATABASE_URL: postgres://quickwit-dev:quickwit-dev@localhost:5432/quickwit-metastore-dev
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the extra container nesting, postgres is actually accessible as localhost.


# Ensures that we cancel running jobs for the same PR / same workflow.
concurrency:
Expand All @@ -25,32 +25,8 @@ concurrency:

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: 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
name: Unit tests
runs-on: "ubuntu-latest"
services:
# PostgreSQL service container
postgres:
Expand All @@ -69,6 +45,8 @@ jobs:
--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
- uses: dorny/paths-filter@v2
id: modified-files
with:
Expand All @@ -77,27 +55,79 @@ jobs:
- quickwit/**
ui-src:
- quickwit/quickwit-ui/**
- name: Setup nightly Rust Toolchain
# 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: nightly
components: rustfmt, clippy
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: stable
override: true
components: rustfmt, clippy
toolchain: nightly
components: rustfmt
- name: Setup stable Rust Toolchain
run: rustup show
working-directory: ./quickwit
- 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 }}
- 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

2 changes: 1 addition & 1 deletion quickwit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[workspace]
resolver = "2"
rust-version = "1.70"
members = [
"quickwit-actors",
"quickwit-aws",
Expand Down Expand Up @@ -414,3 +413,4 @@ sasl2-sys = { git = "https://github.com/quickwit-oss/rust-sasl/", rev = "daca921
#tracing-log = { git = "https://github.com/trinity-1686a/tracing.git", rev = "6806cac3" }
#tracing-opentelemetry = { git = "https://github.com/trinity-1686a/tracing.git", rev = "6806cac3" }
#tracing-subscriber = { git = "https://github.com/trinity-1686a/tracing.git", rev = "6806cac3" }

2 changes: 2 additions & 0 deletions quickwit/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[toolchain]
channel = "1.70"
components = ["cargo", "clippy", "rustfmt", "rust-docs"]

Loading