forked from CometVisu/CometVisu
-
Notifications
You must be signed in to change notification settings - Fork 0
196 lines (191 loc) · 5.98 KB
/
main.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: Build
on:
workflow_dispatch:
push:
paths-ignore:
- '.github/**'
- 'doc/**'
tags-ignore:
- 'v*'
env:
NODE_VERSION: '18.14'
jobs:
lint:
if: ${{ false }} # disable for now
runs-on: ubuntu-latest
steps:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install
- name: Make npm binaries accessible
run: echo "${PWD}/node_modules/.bin" >> $GITHUB_PATH
- name: Lint code
run: qx lint
build:
runs-on: ubuntu-latest
# needs: lint
steps:
- uses: actions/checkout@v3
- name: Build CometVisu
uses: ./.github/actions/build-cv
with:
target: build
unit-test:
name: "UNIT-TEST"
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
target: ['stable', 'beta', 'canary']
browser: ['Chrome_ci']
env:
CV_VERSION: ${{ matrix.target }}
CV_BROWSER: ${{ matrix.browser }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Build CometVisu
uses: ./.github/actions/build-cv
with:
target: source
- name: Install browser
run: ./utils/ci/browser-setup.sh
shell: bash
- name: Install grunt
run: npm install -g grunt-cli
- id: dotenv
uses: falti/dotenv-action@v1.0.4
with:
path: .protractor-env
- name: Run tests
run: grunt karma:ci --browser=$CV_BROWSER
env:
CHROME_BIN: ${{ steps.dotenv.outputs.BROWSER_PATH }}
- name: Run coveralls
if: env.CV_VERSION == 'stable' && env.CV_BROWSER == 'Chrome_ci'
uses: coverallsapp/github-action@master
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
e2e-test:
name: "E2E-TEST"
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
target: ['stable'] # beta is not running currently, 'beta']
browser: ['Chrome_ci']
env:
CV_VERSION: ${{ matrix.target }}
CV_BROWSER: ${{ matrix.browser }}
steps:
- run: sudo rm /usr/bin/chromedriver
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Build CometVisu
uses: ./.github/actions/build-cv
with:
target: source
- name: Install browser
run: ./utils/ci/browser-setup.sh
shell: bash
- id: dotenv
uses: falti/dotenv-action@v1.0.4
with:
path: .protractor-env
- name: Run tests
run: grunt e2e-chrome
env:
CHROME_BIN: ${{ steps.dotenv.outputs.BROWSER_PATH }}
WEBDRIVER_PATH: ${{ steps.dotenv.outputs.WEBDRIVER_PATH }}
deploy-docker:
name: "[DEPLOY] - Deploy Docker container and Sentry release"
if: github.repository == 'CometVisu/CometVisu' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [ 'unit-test', 'e2e-test']
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- run: npm install -g grunt-cli
- run: npm install
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install python dependencies
run: |
python -m pip install -r utils/requirements.txt
- name: Update DocumentationMapping
run: ./cv doc --doc-type manual -f -l de
- name: Create CometVisu release for docker
run: CV_TAG_RUNTIME=docker grunt release-cv
- name: Move to release folder
run: mv release build
- name: Push to Docker Hub
run: ./utils/ci/docker_push.sh
env:
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }}
- run: |
curl -sL https://sentry.io/get-cli/ | bash
export SENTRY_RELEASE=$(sentry-cli releases propose-version)
sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE
sentry-cli releases set-commits --auto $SENTRY_RELEASE
sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps build --no-rewrite --ignore node_modules/ --ignore test/
sentry-cli releases finalize $SENTRY_RELEASE
env:
SENTRY_ORG: cometvisu
SENTRY_PROJECT: cometvisu
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}