166 lines (139 loc) · 5.84 KB
/
pull_requests.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
name: Run tests
on:
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
# FROM: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Start up sqlserver
- run: docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=1StrongPwd!!" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
- run: ./scripts/ci/prepare_linux.sh --integration-tests
- run: yarn format
- run: yarn tsc
- run: cd runner && gofmt -w .
- run: ./scripts/fail_on_diff.sh
- run: yarn test-licenses
# Needed so we can have ./build/desktop_runner.js and ./build/go_desktop_runner ready for tests
- run: yarn build-test-runner
- run: yarn test --runInBand --detectOpenHandles --forceExit --verbose
- run: cd runner && go test -coverprofile ../coverage/gounit.cov
- run: ./runner/scripts/test_coverage.sh
# Test server builds
- run: yarn build-server
server-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
# FROM: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: ./scripts/ci/prepare_go.sh
- run: yarn release-server 0.0.0-install
- run: mv releases/datastation-server-x64-0.0.0-install.zip /tmp/
- run: cd /tmp && unzip datastation-server-x64-0.0.0-install.zip
- run: ls -lah /tmp/build/release
- run: /tmp/build/release/install.sh
- run: bash -c '[[ -d /etc/datastation ]]'
- run: bash -c '[[ -d /usr/share/datastation ]]'
- run: bash -c '[[ -f /usr/share/datastation/server.js ]]'
- run: bash -c '[[ -f /usr/share/datastation/server_runner.js ]]'
- run: bash -c '[[ -f /etc/datastation/config.yaml ]]'
- run: bash -c '[[ -f /etc/systemd/system/datastation.service ]]'
- run: bash -c '[[ -f /etc/systemd/system/datastation-exporter.timer ]]'
e2e-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
# FROM: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: ./scripts/ci/prepare_linux.sh
- run: yarn release-desktop 0.0.0-e2etest
# Set up a virtual framebuffer so Chrome will start
# https://www.electronjs.org/docs/tutorial/testing-on-headless-ci
# https://github.com/juliangruber/browser-run/issues/147
- run: xvfb-run --auto-servernum yarn e2e-test
e2e-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
# FROM: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: ./scripts/ci/prepare_macos.sh
# Needed so we can have ./build/desktop_runner.js ready for tests
- run: yarn build-test-runner
- run: yarn test --runInBand --detectOpenHandles --forceExit --verbose shared ui desktop
- run: cd runner && go test -cover
- run: yarn release-desktop 0.0.0-e2etest
- run: yarn e2e-test
e2e-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
# FROM: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: ./scripts/ci/prepare_windows.ps1
shell: pwsh
# Needed so we can have ./build/desktop_runner.js ready for tests
- run: yarn build-test-runner
- run: yarn test --runInBand --detectOpenHandles --forceExit --verbose shared ui desktop
- run: cd runner && go test -cover
- run: yarn release-desktop 0.0.0-e2etest
- run: yarn e2e-test