Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
os:
- ubuntu-latest
- macos-latest
- windows-latest
browser:
- chrome
include:
Expand All @@ -35,10 +36,10 @@ jobs:
uses: browser-actions/setup-firefox@v1

- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}

Expand All @@ -54,18 +55,30 @@ jobs:
lint: false

- name: Build sample projects
if: runner.os != 'Windows'
run: npm run build:projects

- name: Ensure sample project 'MathlibDemo' is built
if: runner.os != 'Windows'
run: |
cd Projects/MathlibDemo
lake build --no-build

- name: Ensure sample project 'Stable' is built
if: runner.os != 'Windows'
run: |
cd Projects/Stable
lake build --no-build

- name: Build sample projects (Windows)
if: runner.os == 'Windows'
run: |
cd Projects/MathlibDemo
lake exe cache get
lake build
cd ../Stable
lake build

- name: Install dependencies
run: npm ci

Expand All @@ -81,7 +94,7 @@ jobs:

- name: Upload screenshots on failure
if: failure() && steps.cypress_no_video.conclusion == 'failure'
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: cypress-screenshots-${{ matrix.os }}-${{ matrix.browser }}
path: cypress/screenshots
Expand All @@ -97,7 +110,7 @@ jobs:

- name: Upload videos
if: failure() && steps.cypress_no_video.conclusion == 'failure'
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: cypress-videos-${{ matrix.os }}-${{ matrix.browser }}
path: cypress/videos
Expand All @@ -119,7 +132,7 @@ jobs:

- name: Upload screenshots on failure
if: runner.os == 'Linux' && failure() && steps.cypress_production_no_video.conclusion == 'failure'
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: cypress-screenshots-production-${{ matrix.os }}-${{ matrix.browser }}
path: cypress/screenshots
Expand All @@ -134,7 +147,7 @@ jobs:

- name: Upload screenshots on failure
if: matrix.os == 'ubuntu-latest' &&matrix.browser == 'chromium' && failure() && steps.cypress_production_windows_no_video.conclusion == 'failure'
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: cypress-screenshots-production-windows-${{ matrix.os }}-${{ matrix.browser }}
path: cypress/screenshots
Expand All @@ -143,9 +156,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
Expand Down
7 changes: 4 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"private": true,
"type": "module",
"scripts": {
"analyse": "NODE_OPTIONS=--max-old-space-size=8192 npx vite-bundle-analyzer",
"dev": "NODE_ENV=development vite --host",
"build": "NODE_ENV=production vite build"
"analyse": "cross-env NODE_OPTIONS=--max-old-space-size=8192 npx vite-bundle-analyzer",
"dev": "cross-env NODE_ENV=development vite --host",
"build": "cross-env NODE_ENV=production vite build"
},
"dependencies": {
"@emotion/react": "^11.14.0",
Expand All @@ -16,6 +16,7 @@
"@tailwindcss/vite": "^4.1.18",
"@tanstack/query-core": "^5.90.14",
"@uiw/react-codemirror": "^4.25.3",
"cross-env": "^10.1.0",
"file-saver": "^2.0.5",
"focus-trap-react": "^12.0.3",
"jotai": "^2.16.1",
Expand Down
20 changes: 20 additions & 0 deletions doc/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,47 +49,67 @@ On a running system, you might already have these installed, if not:
### Installation

- Clone this repo:

```
git clone --recurse-submodules https://github.com/leanprover-community/lean4web.git
```

note that `--recurse-submodules` is needed to load the predefined projects in `Projects/`. (on an existing clone, you can call `git submodule init` and `git submodule update`)

- Navigate into the cloned repository

```
cd lean4web
```

- Install dependencies

```
npm install
```

### Development mode

- Start the project in development mode

```
npm start
```

- Go to http://localhost:3000

### Production mode

- Compile the project

```
npm run build
```

On Windows, the subcommand `npm run build:projects` might not work as it is implemented with Bash-Scripts. You can call `npm run build:client` instead and have your own logic to build all Lean projects (e.g. call `lake build` inside each project).

- Start the server

```
npm run prod
```

- To disable the bubblewrap containers, start the server with

```
NO_BWRAP=true npm run prod
```

- Start the client seperately, for example with

```
npm run start:client
```

and open http://localhost:3000

- To set the locations of SSL certificates, use the following environment variables:

```
SSL_CRT_FILE=/path/to/crt_file.cer SSL_KEY_FILE=/path/to/private_ssl_key.pem npm run prod
```
Expand Down
31 changes: 25 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
},
"type": "module",
"scripts": {
"dev": "NODE_ENV=development nodemon index.mjs",
"prod": "NODE_ENV=production nodemon index.mjs",
"dev": "cross-env NODE_ENV=development nodemon index.mjs",
"prod": "cross-env NODE_ENV=production nodemon index.mjs",
"build": "echo 'deprecated, use build:projects instead' && npm run build:projects",
"build:projects": "./build.sh"
},
"dependencies": {
"cross-env": "^10.1.0",
"express": "^5.1.0",
"ip-anonymize": "^0.1.0",
"memfs": "^4.51.1",
Expand Down