-
Notifications
You must be signed in to change notification settings - Fork 46
79 lines (76 loc) · 2.1 KB
/
build_test.service.yaml
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
name: build and test service
on:
workflow_dispatch:
workflow_call:
push:
paths:
- .github/workflows/build_test.service.yaml
- .github/workflows/config.yaml
- service/**
jobs:
config:
uses: ./.github/workflows/config.yaml
build:
name: build mage service
needs: config
runs-on: ubuntu-latest
steps:
- name: install system libs
run: |
sudo apt-get install build-essential
- name: checkout
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ needs.config.outputs.node_versions-lts }}
cache: npm
cache-dependency-path: service/npm-shrinkwrap.json
- name: build
run: |
cd service
npm ci
npm run build
- name: package
run: npm pack ./service
- name: upload package
uses: actions/upload-artifact@v3
with:
name: mage.service-artifacts
path: |
ngageoint-mage.service-*.tgz
test:
name: test mage service
needs: [ config, build ]
runs-on: ubuntu-latest
strategy:
matrix:
node: ${{ fromJSON(needs.config.outputs.node_versions-all-json) }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: |
service/npm-shrinkwrap.json
- name: install service dependencies
run: |
cd service
npm ci service
- name: download service package
uses: actions/download-artifact@v3
with:
name: mage.service-artifacts
- name: extract service lib
run: |
tar xzf $(ls -1 ngageoint-mage.service-*.tgz) package/lib
mv package/lib ./service/
rmdir package
- name: test service with node ${{ matrix.node }}
run: |
cd service
npm run ci:test
# TODO: restore coveralls test coverage report - see buildAndTest.yml