Skip to content

Commit 28e2f71

Browse files
committed
Github action test
1 parent 0d1ad26 commit 28e2f71

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,13 @@ jobs:
136136
uses: mymindstorm/setup-emsdk@v11
137137
with:
138138
version: 3.1.44
139+
- name: Use local djinni djinni
140+
if: ${{ github.ref != 'refs/heads/master' }}
141+
run: export CMAKE_DJINNI_OPT="-DDJINNI_EXECUTABLE=$(pwd)/bin/djinni"
139142
- name: Report cmake version
140143
run: cmake --version
141144
- name: Configure cmake
142-
run: cmake -S . -B build -DDJINNI_WITH_WASM=ON
145+
run: cmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -S . -B build -DDJINNI_WITH_WASM=ON -DDJINNI_EXECUTABLE=$(pwd)/bin/djinni
143146
- name: Build release
144147
run: cmake --build build --parallel $(nproc) --config Release
145148

bin/djinni

11.9 MB
Binary file not shown.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#! /usr/bin/env python3
2+
3+
from http.server import HTTPServer, SimpleHTTPRequestHandler
4+
from selenium import webdriver
5+
from selenium.webdriver.common.by import By
6+
from selenium.webdriver.chrome.service import Service
7+
import sys
8+
import threading
9+
10+
port = 8089
11+
httpd = HTTPServer(("127.0.0.1", int(port)), SimpleHTTPRequestHandler)
12+
13+
def run_server():
14+
print("Serving HTTP on localhost port " + port + " (http://localhost:" + port + "/) ...")
15+
httpd.serve_forever()
16+
17+
server_thread = threading.Thread(target=run_server)
18+
server_thread.start()
19+
20+
service = Service(executable_path=r'/usr/bin/chromedriver')
21+
options = webdriver.ChromeOptions()
22+
#options.add_argument('--headless')
23+
options.add_argument('--no-sandbox')
24+
options.add_argument('--disable-dev-shm-usage')
25+
options.add_argument('--disable-gpu')
26+
driver = webdriver.Chrome(service=service, options=options)
27+
print(f"connecting web driver to http://localhost:{port}/")
28+
driver.get(f"http://localhost:{port}/test.html")
29+
#element = driver.find_element(By.NAME, "query")
30+
#assert element.is_enabled()
31+
driver.quit()
32+
finished_tests = True
33+
httpd.shutdown()
34+
server_thread.join()

0 commit comments

Comments
 (0)