-
Notifications
You must be signed in to change notification settings - Fork 31
61 lines (50 loc) · 1.38 KB
/
CI-build-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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: API Build and Test
on:
workflow_call:
jobs:
build-and-test:
name: Build/Test
runs-on: ubuntu-20.04
services:
postgres:
image: postgis/postgis:11-2.5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: inaturalist_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: miyataka/elastic-github-actions/elasticsearch@feature/plugin_support
with:
stack-version: 8.9.0
plugins: analysis-kuromoji
- name: Elasticsearch is reachable
run: |
curl --verbose --show-error http://localhost:9200
- name: Copy config
run: |
cp config.js.ci config.js
touch vision-taxonomy.csv
- run: npm install
- run: npm run coverage
env:
NODE_ENV: test
PGHOST: 0.0.0.0
PGUSER: postgres
PGPASSWORD: postgres
CI: true
- run: npm run eslint