-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (66 loc) · 2.11 KB
/
Copy pathci-server.yml
File metadata and controls
67 lines (66 loc) · 2.11 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
name: ci-server
on:
push:
branches:
- main
paths:
- server/**
- .github/workflows/ci-server.yml
- .github/workflows/build-server.yml
- .github/workflows/deploy-server-dev.yml
- .github/workflows/deploy-server-prod.yml
pull_request:
paths:
- server/**
- .github/workflows/ci-server.yml
- .github/workflows/build-server.yml
- .github/workflows/deploy-server-dev.yml
- .github/workflows/deploy-server-prod.yml
jobs:
ci:
name: ci
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- name: checkout
uses: actions/checkout@v3
- name: cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.49
working-directory: server
args: --timeout=5m
- name: test
run: go test ./... -v -race
# indexer test
- name: 'indexer test: is testdata available'
id: testdata
run: echo $TESTDATA >> $GITHUB_OUTPUT
env:
TESTDATA: ${{ secrets.TESTDATA && 'testdata=1' || 'testdata=' }}
- name: 'indexer test: download test 3D Tiles data'
if: steps.testdata.outputs.testdata
run: curl -O $TESTDATA && mkdir -p searchindex/indexer/testdata && unzip -d searchindex/indexer/testdata "${TESTDATA##*/}"
env:
TESTDATA: ${{ secrets.TESTDATA }}
- name: 'indexer test: run indexer test'
if: steps.testdata.outputs.testdata
run: go test ./searchindex/indexer -v
- name: 'indexer test: list result files'
if: steps.testdata.outputs.testdata
run: ls searchindex/indexer/testdata/result
- name: 'indexer test: cat resultsData.csv'
if: steps.testdata.outputs.testdata
run: cat searchindex/indexer/testdata/result/resultsData.csv