Skip to content

Commit 2894971

Browse files
authored
Workflow that runs daily for testing and building project (#17956)
* Adding daily test * fixing space * fixing space
1 parent 3b23fc6 commit 2894971

File tree

1 file changed

+108
-0
lines changed

1 file changed

+108
-0
lines changed
+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Daily Build and Test
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '18'
20+
21+
- name: Set up xvfb
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
25+
sudo cp build/xvfb.init /etc/init.d/xvfb
26+
sudo chmod +x /etc/init.d/xvfb
27+
sudo update-rc.d xvfb defaults
28+
sudo service xvfb start
29+
30+
- name: Install tools
31+
run: |
32+
echo "Installing Yarn"
33+
npm install --global [email protected]
34+
echo "Installing Gulp CLI"
35+
npm install --global [email protected]
36+
echo "Installing VSCE"
37+
npm install --global [email protected]
38+
echo "Installing gulp"
39+
npm install --global [email protected]
40+
npm install gulp
41+
npm link gulp
42+
43+
- name: Install extension dependencies
44+
run: |
45+
yarn --frozen-lockfile
46+
47+
- name: Install playwright dependencies
48+
run: |
49+
npx playwright install --with-deps
50+
51+
- name: Build extension
52+
run: |
53+
yarn build
54+
55+
- name: Run lint
56+
run: |
57+
yarn lint
58+
59+
- name: Run tests
60+
run: |
61+
DISPLAY=:10 yarn test --coverage --log
62+
63+
- name: Publish test
64+
uses: EnricoMi/publish-unit-test-result-action@v2
65+
if: always()
66+
with:
67+
files: |
68+
./test-reports/**/*.xml
69+
70+
- name: Setup environment for smoke tests
71+
run: |
72+
echo "Setting up environment for smoke tests"
73+
echo "PASSWORD=$(LC_ALL=C tr -dc 'A-Za-z0-9!?%=' < /dev/urandom | head -c 16)$(LC_ALL=C tr -dc '@^#' < /dev/urandom | head -c 1)" >> $GITHUB_ENV
74+
75+
- name: Install mssql
76+
run: |
77+
sudo cp build/mssql.init /etc/init.d/mssql-server
78+
sudo chmod +x /etc/init.d/mssql-server
79+
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
80+
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list)"
81+
sudo apt-get update
82+
sudo apt-get install -y mssql-server
83+
sudo ACCEPT_EULA='Y' MSSQL_PID='Developer' MSSQL_SA_PASSWORD=${{ env.PASSWORD }} /opt/mssql/bin/mssql-conf setup || true
84+
85+
- name: Start mssql
86+
run: |
87+
sudo service mssql-server start
88+
89+
- name: Run smoke tests
90+
run: |
91+
VS_CODE_VERSION=stable
92+
SERVER_NAME=localhost
93+
AUTHENTICATION_TYPE="SQL Login"
94+
USER_NAME=sa
95+
PASSWORD=${{ env.PASSWORD }}
96+
SAVE_PASSWORD=No
97+
PROFILE_NAME=test-server
98+
DISPLAY=:10 yarn smoketest
99+
100+
- name: Publish smoke test
101+
uses: EnricoMi/publish-unit-test-result-action@v2
102+
if: always()
103+
with:
104+
files: |
105+
./test-reports/**/*.trx
106+
107+
108+

0 commit comments

Comments
 (0)