forked from quickwit-oss/quickwit
-
Notifications
You must be signed in to change notification settings - Fork 0
215 lines (204 loc) · 7.73 KB
/
ci.yml
File metadata and controls
215 lines (204 loc) · 7.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- trigger-ci-workflow
paths:
- "quickwit/**"
- "!quickwit/quickwit-ui/**"
permissions:
contents: read
env:
CARGO_INCREMENTAL: 0
QW_DISABLE_TELEMETRY: 1
QW_TEST_DATABASE_URL: postgres://quickwit-dev:quickwit-dev@localhost:5432/quickwit-metastore-dev
RUST_BACKTRACE: 1
RUSTDOCFLAGS: -Dwarnings -Arustdoc::private_intra_doc_links
RUSTFLAGS: -Dwarnings --cfg tokio_unstable
# 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"
timeout-minutes: 60
permissions:
contents: read
actions: write
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:
- name: Cleanup Disk Space
run: |
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /opt/hostedtoolcache/CodeQL
df -h
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install Ubuntu packages
run: |
sudo apt-get update
sudo apt-get -y install protobuf-compiler
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v.6.1.0
with:
python-version: '3.11'
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: modified
with:
filters: |
rust_src:
- quickwit/**/*.rs
- quickwit/**/*.toml
- quickwit/**/*.proto
- quickwit/rest-api-tests/**
- .github/workflows/ci.yml
- name: Setup stable Rust Toolchain
if: steps.modified.outputs.rust_src == 'true'
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # master
with:
toolchain: stable
- name: Setup cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
if: steps.modified.outputs.rust_src == 'true'
with:
workspaces: "./quickwit -> target"
- name: Install nextest
if: always() && steps.modified.outputs.rust_src == 'true'
uses: taiki-e/cache-cargo-install-action@25ef9892608d184944df486ae09ffae168b3cda3 # v3.0.0
with:
tool: cargo-nextest
- name: cargo nextest
if: always() && steps.modified.outputs.rust_src == 'true'
run: cargo nextest run --features=postgres --retries 1
working-directory: ./quickwit
- name: cargo build
if: always() && steps.modified.outputs.rust_src == 'true'
run: cargo build --features=postgres --bin quickwit
working-directory: ./quickwit
- name: Install python packages
if: always() && steps.modified.outputs.rust_src == 'true'
run: |
pip install --user --require-hashes -r ${{ github.workspace }}/.github/workflows/requirements.txt
pipenv install --deploy --ignore-pipfile
working-directory: ./quickwit/rest-api-tests
- name: Run REST API tests
if: always() && steps.modified.outputs.rust_src == 'true'
run: pipenv run python3 ./run_tests.py --binary ../target/debug/quickwit
working-directory: ./quickwit/rest-api-tests
lints:
name: Lints
runs-on: "ubuntu-latest"
timeout-minutes: 60
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: modified
with:
filters: |
rust_src:
- quickwit/**/*.rs
- quickwit/**/*.toml
- quickwit/**/*.proto
- .github/workflows/ci.yml
- name: Install Ubuntu packages
if: always() && steps.modified.outputs.rust_src == 'true'
run: |
sudo apt-get update
sudo apt-get -y install protobuf-compiler
- name: Setup nightly Rust Toolchain (for rustfmt)
if: steps.modified.outputs.rust_src == 'true'
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # master
with:
toolchain: nightly
components: rustfmt
- name: Setup stable Rust Toolchain
if: steps.modified.outputs.rust_src == 'true'
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # master
with:
toolchain: stable
- name: Setup cache
if: steps.modified.outputs.rust_src == 'true'
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
workspaces: "./quickwit -> target"
- name: Install cargo deny
if: always() && steps.modified.outputs.rust_src == 'true'
uses: taiki-e/cache-cargo-install-action@25ef9892608d184944df486ae09ffae168b3cda3 # v3.0.0
with:
# 0.18 requires rustc 1.85
tool: cargo-deny@0.17.0
- name: Install cargo machete
if: always() && steps.modified.outputs.rust_src == 'true'
uses: taiki-e/cache-cargo-install-action@25ef9892608d184944df486ae09ffae168b3cda3 # v3.0.0
with:
tool: cargo-machete
- name: cargo clippy
if: always() && steps.modified.outputs.rust_src == 'true'
run: cargo clippy --workspace --tests --all-features
working-directory: ./quickwit
- name: cargo deny
if: always() && steps.modified.outputs.rust_src == 'true'
run: cargo deny check licenses
working-directory: ./quickwit
- name: cargo machete
if: always() && steps.modified.outputs.rust_src == 'true'
run: cargo machete
working-directory: ./quickwit
- name: cargo doc
if: always() && steps.modified.outputs.rust_src == 'true'
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() && steps.modified.outputs.rust_src == 'true'
run: cargo +nightly fmt --all -- --check
working-directory: ./quickwit
thirdparty-license:
name: Check Datadog third-party license file
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # master
with:
toolchain: stable
- name: Cache cargo tools
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-tools-${{ hashFiles('**/Cargo.lock') }}
- name: Install dd-rust-license-tool
run: dd-rust-license-tool --help || cargo install --git https://github.com/DataDog/rust-license-tool.git --force
- name: Check Datadog third-party license file
run: dd-rust-license-tool --config quickwit/license-tool.toml --manifest-path quickwit/Cargo.toml check