Skip to content

Commit 34064c5

Browse files
committed
test new action
1 parent aff9a94 commit 34064c5

File tree

4 files changed

+77
-7
lines changed

4 files changed

+77
-7
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test on Linux server
2+
run-name: Test on Linux server
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["main"] # replace "main" with the default branch
7+
pull_request:
8+
branches: ["main"]
9+
jobs:
10+
start-server:
11+
runs-on: ubuntu-latest
12+
# outputs:
13+
# server-url: ${{ steps.server-output.outputs.server-url }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
submodules: true
18+
- uses: actions/setup-node@v4
19+
- uses: leanprover/lean-action@v1
20+
with:
21+
lake-package-directory: "demo/server/LeanProject"
22+
use-mathlib-cache: false
23+
auto-config: false
24+
build: true
25+
test: false
26+
lint: false
27+
- name: Install dependencies
28+
run: npm install
29+
- name: Install server dependencies
30+
run: |
31+
cd demo/server
32+
npm install
33+
- name: Build lean4monaco
34+
run: npm run build
35+
- name: Build demo server
36+
run: |
37+
cd demo/server
38+
npm run build
39+
- name: Start server
40+
id: start-server
41+
run: |
42+
cd demo/server
43+
echo "Starting server..."
44+
nohup npm run start &> server.log
45+
- name: Sleep
46+
run: sleep 5
47+
run-cypress:
48+
runs-on: windows-latest
49+
needs: start-server
50+
steps:
51+
- uses: actions/checkout@v4
52+
with:
53+
submodules: true
54+
- uses: actions/setup-node@v4
55+
56+
- name: Install dependencies
57+
run: npm install
58+
- name: Wait for server
59+
run: |
60+
echo "Pinging the server to check if it's up..."
61+
for i in {1..30}; do
62+
curl -sSf http://localhost:5173 && break
63+
echo "Waiting for server..."
64+
sleep 5
65+
done
66+
67+
- name: Run Cypress tests
68+
run: |
69+
wait-on http://localhost:5173
70+
cypress run

demo/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
"type": "module",
66
"scripts": {
77
"postinstall": "cd server && npm install",
8-
"build_server": "cd server/LeanProject && lake build",
9-
"start_server": "cd server && npm start",
8+
"build_client": "tsc -b && vite build",
9+
"build_server": "cd server && npm run build",
10+
"build": "concurrently \"npm run build_client &&\" \"npm run build_server\" -n client,server -c \"bgBlue.bold,bgMagenta.bold\"",
1011
"start_client": "vite --host",
12+
"start_server": "cd server && npm run build && npm run start",
1113
"start": "concurrently \"npm run start_client\" \"npm run start_server\" -n client,server -c \"bgBlue.bold,bgMagenta.bold\"",
12-
"build_client": "tsc -b && vite build",
13-
"build": "npm run build_client && npm run build_server",
14-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
15-
"preview": "concurrently \"vite preview\" \"npm run start_server\" -n client,server -c \"bgBlue.bold,bgMagenta.bold\""
14+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
1615
},
1716
"dependencies": {
1817
"lean4monaco": "file:..",

demo/server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"main": "index.mjs",
55
"scripts": {
6+
"build": "cd LeanProject && lake build",
67
"start": "node index.mjs"
78
},
89
"author": "",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"setup_demo": "concurrently \"(cd demo && npm install)\" \"npm run build\" -n install,build -c \"bgCyan.bold,bgBlue.bold\"",
3737
"start": "npm run setup_demo && concurrently \"tsc -w --preserveWatchOutput\" \"webpack --watch\" \"npm run watch:copyfiles\" \"cd demo && npm run start_client\" \"cd demo && npm run start_server\" -n tsc,webpack,copyfiles,vite,server -c \"bgGreen.bold,bgBlue.bold,bgCyan.bold,bgYellow.bold,bgMagenta.bold\"",
3838
"watch:copyfiles": "nodemon --watch ./src --exec \"npm run build:copyfiles\"",
39-
"build": "tsc && webpack && npm run build:copyfiles",
4039
"build:copyfiles": "cd src && copyfiles \"**/*.json\" \"**/*.css\" \"**/*.ttf\" \"**/*.otf\" \"**/*.svg\" ../dist/",
40+
"build": "tsc && webpack && npm run build:copyfiles",
4141
"test": "concurrently --hide 0 --kill-others \"npm start\" \"wait-on http://localhost:5173 && cypress run\" -n server,cypress -s command-cypress"
4242
},
4343
"dependencies": {

0 commit comments

Comments
 (0)