-
Notifications
You must be signed in to change notification settings - Fork 431
171 lines (161 loc) · 5.01 KB
/
ci.yml
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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- trigger-ci-workflow
paths:
- "Cargo.lock"
- "Cargo.toml"
- "quickwit-*/**"
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings -Arustdoc::private_intra_doc_links
jobs:
ci-passes:
name: CI passes
runs-on: ubuntu-latest
# See https://github.com/quickwit-inc/quickwit-builder
container: public.ecr.aws/l6o9a3f9/quickwit-builder:latest
needs:
- lint
- test
steps:
- run: exit 0
lint:
name: Lint (fmt, dependency check, clippy)
runs-on: ubuntu-latest
container: public.ecr.aws/l6o9a3f9/quickwit-builder:latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
js:
- 'quickwit-ui/**'
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: rustfmt
run: cargo +nightly fmt --all -- --check
- name: license-headers-check
run: bash scripts/check_license_headers.sh
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --tests
- uses: actions-rs/cargo@v1
name: cargo deny
with:
command: deny
args: check Licenses # check that all of deps have an ok license.
- name: cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --all-features --document-private-items
- uses: c-hive/gha-yarn-cache@v2
with:
directory: quickwit-ui
- name: Install JS dependencies
if: ${{ steps.filter.outputs.js == 'true' }}
run: yarn --cwd quickwit-ui install
- name: Lint react app
if: ${{ steps.filter.outputs.js == 'true' }}
run: yarn --cwd quickwit-ui lint
test:
name: Run unit tests (no [ignored])
runs-on: ubuntu-latest
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
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
js:
- 'quickwit-ui/**'
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Compile tests
run: cargo test --features=postgres --no-run --locked
- name: Run tests
run: cargo test --features=postgres -- --nocapture --quiet
env:
TEST_DATABASE_URL: postgres://quickwit-dev:quickwit-dev@postgres:5432/quickwit-metastore-dev
- uses: c-hive/gha-yarn-cache@v2
with:
directory: quickwit-ui
- name: Install JS dependencies
if: ${{ steps.filter.outputs.js == 'true' }}
run: yarn --cwd quickwit-ui install
- name: Run react tests
if: ${{ steps.filter.outputs.js == 'true' }}
run: yarn --cwd quickwit-ui test
- name: Cypress run
if: ${{ steps.filter.outputs.js == 'true' }}
run: |
CI=false yarn --cwd quickwit-ui build
cargo build --features=postgres
mkdir qwdata
target/debug/quickwit run --service searcher --config config/quickwit.yaml &
yarn --cwd quickwit-ui cypress run
# See #473 #472
# - uses: actions-rs/cargo@v1
# name: cargo test failpoints
# with:
# command: test
# args: --features fail/failpoints test_failpoint -- --test-threads 1
# test:
# name: Run tests
# runs-on: ubuntu-latest
# container: public.ecr.aws/l6o9a3f9/quickwit-builder:latest
# services:
# localstack:
# image: localstack/localstack:latest
# ports:
# - "4566:4566"
# env:
# SERVICES: s3
# HOSTNAME_EXTERNAL: localstack
# env:
# AWS_ACCESS_KEY_ID : "placeholder"
# AWS_SECRET_ACCESS_KEY: "placeholder"
# AWS_DEFAULT_REGION : "localhost"
# container:
# image: public.ecr.aws/l6o9a3f9/quickwit-builder:latest
# steps:
# - uses: actions/checkout@v3
# - name: Create bucket in localstack
# run: /usr/local/bin/aws --endpoint-url=http://localstack:4566 s3 mb s3://quickwit-integration-tests
# - name: Run all tests.
# env:
# AWS_ACCESS_KEY_ID: dummy-access-key
# AWS_SECRET_ACCESS_KEY: dummy-secret-key
# run: cargo test --all-features