1
+ name : Pre-release tests
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ test-jupyterlab-demos :
10
+ runs-on : ubuntu-20.04
11
+ timeout-minutes : 60
12
+ strategy :
13
+ matrix :
14
+ python-version : ['3.7', '3.8', '3.10']
15
+ fail-fast : false
16
+
17
+ steps :
18
+ - name : Cancel Previous Runs
19
+ uses : styfle/cancel-workflow-action@0.7.0
20
+ with :
21
+ access_token : ${{ github.token }}
22
+ - uses : actions/checkout@v2
23
+ - name : Set up Python ${{ matrix.python-version }}
24
+ uses : actions/setup-python@v2
25
+ with :
26
+ python-version : ${{ matrix.python-version }}
27
+ cache : pip
28
+ cache-dependency-path : |
29
+ mitosheet/setup.py
30
+ tests/requirements.txt
31
+ - uses : actions/setup-node@v3
32
+ with :
33
+ node-version : 16
34
+ cache : ' npm'
35
+ cache-dependency-path : mitosheet/package-lock.json
36
+ - name : Install dependencies
37
+ run : |
38
+ cd tests
39
+ python3 -m venv venv
40
+ source venv/bin/activate
41
+ pip install mitosheet
42
+ pip install --upgrade -i https://test.pypi.org/simple/ mitosheet
43
+ # Install necessary node packages
44
+ npm install
45
+ npx playwright install chromium webkit firefox chrome
46
+
47
+ - name : Start a server and run tests
48
+ run : |
49
+ cd tests
50
+ source venv/bin/activate
51
+ jupyter lab --config jupyter_server_test_config.py &
52
+ npm run test:jupyterlab
53
+ - name : Upload test-results
54
+ uses : actions/upload-artifact@v3
55
+ if : failure()
56
+ with :
57
+ name : jupyterlab-playwright-report-${{ matrix.python-version }}
58
+ path : tests/playwright-report/
59
+ retention-days : 14
60
+
61
+ test-streamlit-demos :
62
+ timeout-minutes : 60
63
+ strategy :
64
+ matrix :
65
+ os : ['ubuntu-latest', 'macos-latest', 'windows-latest']
66
+ python-version : ['3.10']
67
+ demo : ['vanguard-fund-performance']
68
+ project : ['chromium', 'firefox', 'webkit', 'Google Chrome', 'Microsoft Edge']
69
+ exclude :
70
+ - os : ' windows-latest'
71
+ project : webkit
72
+ - os : ' macos-latest'
73
+ project : ' Microsoft Edge'
74
+ - os : ' ubuntu-latest'
75
+ project : ' Microsoft Edge'
76
+ - os : ' ubuntu-latest'
77
+ project : ' webkit'
78
+ fail-fast : false
79
+ runs-on : ${{ matrix.os }}
80
+
81
+ steps :
82
+ - uses : actions/checkout@v2
83
+ - name : Set up Python ${{ matrix.python-version }}
84
+ uses : actions/setup-python@v2
85
+ with :
86
+ python-version : ${{ matrix.python-version }}
87
+ cache : pip
88
+ cache-dependency-path : |
89
+ mitosheet/setup.py
90
+ tests/requirements.txt
91
+ tests/extra-requirements.txt
92
+ - uses : actions/setup-node@v3
93
+ with :
94
+ node-version : 16
95
+ cache : ' npm'
96
+ cache-dependency-path : mitosheet/package-lock.json
97
+ - name : Install dependencies (ubuntu, macos)
98
+ if : matrix.os != 'windows-latest'
99
+ run : |
100
+ cd tests
101
+ python3 -m venv venv
102
+ source venv/bin/activate
103
+ pip install mitosheet streamlit
104
+ pip install --upgrade -i https://test.pypi.org/simple/ mitosheet
105
+ # Install necessary node packages
106
+ npm install
107
+ npx playwright install chromium webkit firefox chrome
108
+ - name : Setup streamlit (ubuntu, macos)
109
+ if : matrix.os != 'windows-latest'
110
+ run : |
111
+ mkdir -p ~/.streamlit/
112
+ echo "[general]" > ~/.streamlit/credentials.toml
113
+ echo "email = \"\"" >> ~/.streamlit/credentials.toml
114
+ - name : Setup streamlit (windows)
115
+ if : matrix.os == 'windows-latest'
116
+ run : |
117
+ $streamlitDir = "$HOME\.streamlit"
118
+ if (-not (Test-Path -Path $streamlitDir)) {
119
+ New-Item -ItemType Directory -Path $streamlitDir
120
+ }
121
+ Set-Content -Path "$streamlitDir\credentials.toml" -Value @"
122
+ [general]
123
+ email = ""
124
+ "@
125
+ - name : Install dependencies (windows)
126
+ if : matrix.os == 'windows-latest'
127
+ run : |
128
+ cd tests
129
+ python3 -m venv venv
130
+ .\venv\Scripts\Activate.ps1
131
+ pip install mitosheet streamlit
132
+ pip install --upgrade -i https://test.pypi.org/simple/ mitosheet
133
+ # Install necessary node packages
134
+ npm install
135
+ npx playwright install chromium webkit firefox chrome
136
+ - name : Start a server and run tests (ubuntu, macos)
137
+ if : matrix.os != 'windows-latest'
138
+ run : |
139
+ cd tests
140
+ source venv/bin/activate
141
+ git clone https://github.com/mito-ds/every-feature-everywhere-all-at-once.git
142
+ cd every-feature-everywhere-all-at-once
143
+ streamlit run automation-app.py --server.port 8555 &
144
+ bash ../check_server.sh
145
+ npm run test:streamlit:demo -- --project="${{ matrix.project }}"
146
+ - name : Start a server and run tests (windows)
147
+ if : matrix.os == 'windows-latest'
148
+ run : |
149
+ cd tests
150
+ .\venv\Scripts\Activate.ps1
151
+
152
+ git clone https://github.com/mito-ds/every-feature-everywhere-all-at-once.git
153
+ cd every-feature-everywhere-all-at-once
154
+ Start-Job { streamlit run automation-app.py --server.port 8555 } -WorkingDirectory (Get-Location)
155
+ npm run test:streamlit:demo -- --project="${{ matrix.project }}"
156
+ - name : Upload test-results
157
+ uses : actions/upload-artifact@v3
158
+ if : always()
159
+ with :
160
+ name : streamlit-playwright-report
161
+ path : tests/playwright-report/
162
+ retention-days : 14
163
+
164
+
0 commit comments