Skip to content

Commit

Permalink
test new action
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Aug 23, 2024
1 parent aff9a94 commit 34064c5
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test on Linux server
run-name: Test on Linux server
on:
workflow_dispatch:
push:
branches: ["main"] # replace "main" with the default branch
pull_request:
branches: ["main"]
jobs:
start-server:
runs-on: ubuntu-latest
# outputs:
# server-url: ${{ steps.server-output.outputs.server-url }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
- uses: leanprover/lean-action@v1
with:
lake-package-directory: "demo/server/LeanProject"
use-mathlib-cache: false
auto-config: false
build: true
test: false
lint: false
- name: Install dependencies
run: npm install
- name: Install server dependencies
run: |
cd demo/server
npm install
- name: Build lean4monaco
run: npm run build
- name: Build demo server
run: |
cd demo/server
npm run build
- name: Start server
id: start-server
run: |
cd demo/server
echo "Starting server..."
nohup npm run start &> server.log
- name: Sleep
run: sleep 5
run-cypress:
runs-on: windows-latest
needs: start-server
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4

- name: Install dependencies
run: npm install
- name: Wait for server
run: |
echo "Pinging the server to check if it's up..."
for i in {1..30}; do
curl -sSf http://localhost:5173 && break
echo "Waiting for server..."
sleep 5
done
- name: Run Cypress tests
run: |
wait-on http://localhost:5173
cypress run
11 changes: 5 additions & 6 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"type": "module",
"scripts": {
"postinstall": "cd server && npm install",
"build_server": "cd server/LeanProject && lake build",
"start_server": "cd server && npm start",
"build_client": "tsc -b && vite build",
"build_server": "cd server && npm run build",
"build": "concurrently \"npm run build_client &&\" \"npm run build_server\" -n client,server -c \"bgBlue.bold,bgMagenta.bold\"",
"start_client": "vite --host",
"start_server": "cd server && npm run build && npm run start",
"start": "concurrently \"npm run start_client\" \"npm run start_server\" -n client,server -c \"bgBlue.bold,bgMagenta.bold\"",
"build_client": "tsc -b && vite build",
"build": "npm run build_client && npm run build_server",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "concurrently \"vite preview\" \"npm run start_server\" -n client,server -c \"bgBlue.bold,bgMagenta.bold\""
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
},
"dependencies": {
"lean4monaco": "file:..",
Expand Down
1 change: 1 addition & 0 deletions demo/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"main": "index.mjs",
"scripts": {
"build": "cd LeanProject && lake build",
"start": "node index.mjs"
},
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"setup_demo": "concurrently \"(cd demo && npm install)\" \"npm run build\" -n install,build -c \"bgCyan.bold,bgBlue.bold\"",
"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\"",
"watch:copyfiles": "nodemon --watch ./src --exec \"npm run build:copyfiles\"",
"build": "tsc && webpack && npm run build:copyfiles",
"build:copyfiles": "cd src && copyfiles \"**/*.json\" \"**/*.css\" \"**/*.ttf\" \"**/*.otf\" \"**/*.svg\" ../dist/",
"build": "tsc && webpack && npm run build:copyfiles",
"test": "concurrently --hide 0 --kill-others \"npm start\" \"wait-on http://localhost:5173 && cypress run\" -n server,cypress -s command-cypress"
},
"dependencies": {
Expand Down

0 comments on commit 34064c5

Please sign in to comment.