-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
.travis.yml
108 lines (102 loc) · 3.42 KB
/
.travis.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
language: node_js
node_js:
- '12.22.12'
os:
- linux
cache:
yarn: true
directories:
- lib
- coverage
env:
global:
- YARN_GPG=no
notifications:
slack:
if: branch = master AND type = push
secure: AKt6cnaKZ8Fox3dIHVPzmQP5ROMG3zI0DzOsb3ShLfp8qJwMVJquqKnUG6j7CZKoK0UI4XkMd7PebLmEmExW7A4MjnWZ5VPy4VzpysQP2oV0JI7qEhSUzzwh1C7J+SH5EmNr7JrZW7H5LEiFpCJ00Of2C7kHmOaok/iBM3Nvz9OCiusT+BwmNSVxrkQjiqSmYKTolZhThYPnKwgNcqfIrpXv55Oei3rCFMRzyNnqUQk2mrdW5iitHWjxYLByThDfaf7iZ3SqdDMnx1OYsvuim0Nkr3HQ4KINiOQ6+6cYfuA6b2qGl7UVM/7lP6WfDU/Owe4yYfWK/xS4Po5WeDEi+z4V/V8FTtEtSnK1gez+NnOClKaui89FMavRqe+BKqDFNeDOoDNGCIs8MhsNLt+tTFCa7JfKIukgiYoHlPT5LfS8HIruTglMF7gsp1KTn0o9nuyaGblGblcCldz1QIo16lFnw+0JZIZR1Odn5nit96fLMoXxH6WUX7TShXgcp+RwbjyTEOWJnKtIRQO8BJ2Hjo9GH+J6u5OQ0+v8KlIgJ3E0IkTJTxMM225gfwJ95sv5rMYQByCw40yKa4+K48BEBFB49vwOOq6vDdsfyaowGIFJ0Hl9h3mQb9bOmq5iXt/5ByCP+XHiAkThuIdQCUQftzVj5WRD5rntrRwM5GUjyIk=
on_success: change
on_failure: change
email:
if: branch = master AND type = push
recipients:
on_success: never
on_failure: always
script:
- yarn install
jobs:
fast_finish: true
include:
- stage: test
name: Build
script:
- yarn install
- yarn build
- stage: test
name: Test
script:
- yarn test --coverage
- bin/run --help
- yarn test:codecov:upload
- bin/run run . --fail=high
- stage: test
name: Run Linter
script:
- yarn lint
- yarn codecov
- stage: runtime test
name: Run Live Tests on Windows
if: branch = master
script:
- npm -g i .
- dx-scanner run https://github.com/DXHeroes/dx-scanner --fail=off
os: windows
- stage: runtime test
name: Run Live Tests on Linux
if: branch = master
script:
- npm -g i .
- dx-scanner run https://github.com/DXHeroes/dx-scanner --fail=off
os: linux
- stage: release
name: Release NPM Package
node_js: lts/*
# script: skip
deploy:
provider: script
email: [email protected]
skip_cleanup: true
script:
- npx semantic-release
on:
all_branches: true
- stage: build docker image
name: "Publish Docker Image for Github Action"
if: branch = master AND type = push
node_js: lts/*
env:
- CONTAINER_NAME=docker.pkg.github.com/dxheroes/dx-scanner/release
script:
- docker build -f action/Dockerfile -t $CONTAINER_NAME .
- docker login -u dxheroes -p $DOCKER_GITHUB_PASSWORD docker.pkg.github.com
- docker push $CONTAINER_NAME
# - stage: build docker image
# name: "Publish Docker Image with DX Scanner"
# if: branch = master AND type = push
# node_js: lts/*
# env:
# - CONTAINER_NAME=dxheroes/dx-scanner
# script:
# - "export DOCKER_IMG_TAG=$(cat package.json | jq -r .version)" # it doesn't work; it takes the previous version instead of the newest because it's not yet pulled
# - |
# if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $CONTAINER_NAME:$DOCKER_IMG_TAG >/dev/null; then
# echo The image $CONTAINER_NAME:$DOCKER_IMG_TAG already exists
# else
# echo Build new image
# docker build -t $CONTAINER_NAME:$DOCKER_IMG_TAG .
# echo "Current image is $CONTAINER_NAME:$DOCKER_IMG_TAG"
# docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASSWORD
# docker push $CONTAINER_NAME:$DOCKER_IMG_TAG
# fi