Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 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
54 changes: 54 additions & 0 deletions .github/workflows/test.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Tests

on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
setup:
runs-on: ubuntu-latest
name: Compile and test MathJax
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false

- name: Install packages
run: |
pnpm -r i
pnpm link:src

- name: Temporarily make link
run: |
cd node_modules
ln -s @mathjax/src mathjax-full
cd ..

- name: Compile MathJax
run: |
pnpm mjs:compile
components/bin/makeAll --mjs --terse --build components/mjs
pnpm cjs:compile
pnpm cjs:components:src:build
components/bin/makeAll --cjs --terse --build components/cjs
pnpm copy:pkg cjs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be willing to use pnpm -s rather than just pnpm for these (and the ones below)? That way, you only see that script output rather than the pnpm commands themselves. I think that looks cleaner.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


- name: Build tests
run: pnpm tsc -p testsuite/tsconfig.json

- name: Run tests
run: pnpm test:gh

- name: Upload coverage to GitHub
uses: codecov/codecov-action@v2
with:
file: ./coverage/lcov.info # Path to the coverage file
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
![npm monthly downloads (full)](https://img.shields.io/npm/dm/mathjax-full?label=npm%20%28full%29)
![npm total downloads](https://img.shields.io/npm/dt/mathjax.svg?style=flat&label=npm%20total)
![npm total downloads](https://img.shields.io/npm/dt/mathjax-full.svg?style=flat&label=npm%20total%20%28full%29)
![test workflow](https://github.com/MathJax/MathJax-src/actions/workflows/test.js.yml/badge.svg?branch=develop)
[![codecov](https://codecov.io/gh/mathjax/mathjax-src/develop/main/graph/badge.svg)](https://codecov.io/gh/mathjax/mathjax-src)

## Beautiful math in all browsers

Expand Down
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
"use-cjs": "echo '{\n \"extends\": \"./tsconfig/cjs.json\"\n}' > tsconfig.json",
"use-mjs": "echo '{\n \"extends\": \"./tsconfig/mjs.json\"\n}' > tsconfig.json",
"=============================================================================== aliases": "",
"test": "cd testsuite && pnpm -s test --",
"test": "cd testsuite && pnpm -s test --verbose",
"test:gh": "cd testsuite && pnpm -s test --silent",
"clean": "pnpm -s clean:mod cjs && pnpm -s cjs:bundle:clean && pnpm -s clean:mod mjs && pnpm -s clean:dir bundle",
"compile-cjs": "pnpm -s cjs:compile",
"compile-mjs": "pnpm -s mjs:compile",
Expand All @@ -140,21 +141,21 @@
"devDependencies": {
"copyfiles": "^2.4.1",
"diff": "^5.2.0",
"eslint": "^9.7.0",
"eslint": "^9.28.0",
"eslint-formatter-unix": "^8.40.0",
"eslint-plugin-jsdoc": "^48.11.0",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"rimraf": "^5.0.5",
"terser-webpack-plugin": "^5.3.10",
"typescript": "^5.4.5",
"typescript-eslint": "^8.0.0",
"eslint-plugin-prettier": "^5.4.1",
"husky": "^9.1.7",
"lint-staged": "^15.5.2",
"prettier": "^3.5.3",
"rimraf": "^5.0.10",
"terser-webpack-plugin": "^5.3.14",
"typescript": "^5.8.3",
"typescript-eslint": "^8.33.1",
"typescript-tools": "^0.3.1",
"webpack": "^5.91.0",
"webpack": "^5.99.9",
"webpack-cli": "^5.1.4",
"xslt3": "^2.6.0"
"xslt3": "^2.7.0"
},
"lint-staged": {
"ts/**/*.ts": [
Expand All @@ -167,7 +168,7 @@
"@xmldom/xmldom": "^0.8.10",
"mhchemparser": "^4.2.1",
"mj-context-menu": "^0.9.1",
"speech-rule-engine": "^5.0.0-alpha.4",
"speech-rule-engine": "5.0.0-alpha.4",
"wicked-good-xpath": "^1.3.0"
}
}
Loading