-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 1.23 KB
/
build-and-test.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
name: Build & Test
on: pull_request
jobs:
search:
runs-on: ubuntu-latest
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
ports:
- 9200/tcp
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build typescript
run: npm run build
- name: Run linter
run: npm run lint
- name: Run typecheck
run: npm run types
- name: Verify Elasticsearch connection from host
env:
ELASTICSEARCH_URL: http://localhost:${{ job.services.elasticsearch.ports[9200] }}
run: |
echo $ELASTICSEARCH_URL
curl -fsSL "$ELASTICSEARCH_URL/_cat/health?h=status"
- name: Run tests
env:
INDEX_CHUNK_SIZE: 100
ELASTICSEARCH_URL: http://localhost:${{ job.services.elasticsearch.ports[9200] }}
run: npm test -- --forceExit