Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
b090d58
Initial commit for French braille.
NSoiffer Sep 27, 2024
7b75709
Added a table of atomic numbers for the elements and added a test for…
NSoiffer Sep 27, 2024
5136cb3
renamed test
NSoiffer Sep 27, 2024
fca6ce0
Merge branch 'main' into French-Braille
NSoiffer May 30, 2025
4ccda5f
Update braille.rs to compile after merging.
NSoiffer May 30, 2025
34ce947
Merge branch 'main' into French-Braille
NSoiffer Nov 19, 2025
596e210
Merge branch 'main' into French-Braille
NSoiffer Jun 6, 2026
c7eda2c
Updated to main. Needed to update the format of the tests to match t…
NSoiffer Jun 6, 2026
b163b6b
Merge main into French-Braille: fold French into BrailleCode trait
NSoiffer Jun 16, 2026
62dfe83
It appears some logic was missing parens -- not sure why this always …
NSoiffer Jun 22, 2026
3c5b101
Lots more cleanup of tests, additions of rules.
NSoiffer Jun 22, 2026
fffcc73
fix clippy warning
NSoiffer Jun 22, 2026
de9751d
More fixes for French braille. Now at 89 correct, 8 fail, with most o…
NSoiffer Jun 25, 2026
f9ba42a
pass through braille chars as is
NSoiffer Jun 25, 2026
4d848ed
Merge branch 'main' into French-Braille
NSoiffer Aug 3, 2026
822485d
Merge branch 'main' into French-Braille
NSoiffer Aug 3, 2026
52d91c2
UEB has a rule for some pseudo-script chars. The match for that rule …
NSoiffer Aug 5, 2026
baf7de6
Added new UEB chars. Many of these are accented letters. I added 'A' …
NSoiffer Aug 5, 2026
916978c
change small spaces from 'W' to ''
NSoiffer Aug 6, 2026
6bddbda
add 'H' for Hebrew alphabet indicator
NSoiffer Aug 6, 2026
6af4178
promote munder/mover/munderover base attrs to element -- prevents err…
NSoiffer Aug 6, 2026
1046bd5
all primes on chem symbols such as R' -- used to be a reject, now neu…
NSoiffer Aug 7, 2026
af250aa
Fix leftover value for G1 indicator -- unlike UEB, French braille num…
NSoiffer Aug 7, 2026
f481cd5
Lots of fixes and addition of tests.
NSoiffer Aug 7, 2026
d743060
Add "(eau)" as a state (for French)
NSoiffer Aug 7, 2026
0d7a39a
add more arrows. French at the moment doesn't seem to distinguish bet…
NSoiffer Aug 7, 2026
363fc51
removed some intent attrs that were not needed
NSoiffer Aug 7, 2026
9588ed9
uncomment a determinant test after fixing the braille
NSoiffer Aug 7, 2026
4408cb2
Add rules for multiple lines in a script position done via an mtable …
NSoiffer Aug 7, 2026
5c48268
a linebreaks to MathML to make it easier to read
NSoiffer Aug 7, 2026
9b2ac74
Merge branch 'main' into French-Braille
NSoiffer Aug 7, 2026
e5a9c87
add more arrow chars -- I thought I did this in a previous commit, bu…
NSoiffer Aug 7, 2026
c2dbcc6
Add MathJax demo link to developer docs for rendering inspection
moritz-gross Aug 15, 2026
eebb4be
.
moritz-gross Aug 15, 2026
8e886cc
Merge changes (mostly unicode) from hu branch (#688)
NSoiffer Aug 15, 2026
7fbaf17
Ru -- merge speech changes into main (#689)
NSoiffer Aug 15, 2026
0380bb0
Remove unused and commented-out code (#680)
moritz-gross Aug 15, 2026
d4a112a
Update demo link in developers documentation
moritz-gross Aug 15, 2026
8305b6f
Merge pull request #687 from moritz-gross/link-mathjax-demo-as-helpfu…
moritz-gross Aug 15, 2026
6ecc412
Did cleanup with ranges to shrink file size. The big win was the 'id'…
NSoiffer Aug 16, 2026
2e1301f
Merge branch 'main' of https://github.com/daisy/MathCAT
NSoiffer Aug 16, 2026
fbc49bb
Announce column separator (#679)
moritz-gross Aug 16, 2026
d5c63d8
fix clippy warnings in the no-unsafe version
NSoiffer Aug 16, 2026
78744ec
Revert changes to file from 6ecc412
NSoiffer Aug 16, 2026
a1fc8e0
missed this change that needed to be reverted for Russian braille
NSoiffer Aug 16, 2026
bc712eb
fix AGENTS.md instruction on `uv run pytest`
moritz-gross Aug 16, 2026
58aa858
Merge pull request #693 from moritz-gross/main
moritz-gross Aug 16, 2026
6937925
Merge latest hu changes (#696)
NSoiffer Aug 17, 2026
adbf1e5
move to release candidate
NSoiffer Aug 17, 2026
2267de3
Added creation of minified yaml files for an alternative Rules.zip
NSoiffer Aug 17, 2026
487ce71
fix build problem
NSoiffer Aug 17, 2026
65250fc
try again for creation of minified yaml files for an alternative Rule…
NSoiffer Aug 17, 2026
0bac005
try again -- needs to run on linux
NSoiffer Aug 17, 2026
80b749a
Add standalone Rules packaging script
NSoiffer Aug 17, 2026
b1f15e9
try again with more files in github
NSoiffer Aug 17, 2026
43af561
try again adding 'zz' test dir for testing
NSoiffer Aug 17, 2026
82e8188
internally zip of the Language/Braille dirs
NSoiffer Aug 17, 2026
082afd1
add another file for packaging the rules
NSoiffer Aug 17, 2026
61c04bd
trying again with zipping -- AI is not doing a very good job...
NSoiffer Aug 18, 2026
917dbe5
Merged the messy multiple files AI created into one file
NSoiffer Aug 18, 2026
3bb491d
AI keeps messing with things it shouldn't...
NSoiffer Aug 18, 2026
7af9ec3
remove inappropriate check
NSoiffer Aug 18, 2026
786d058
Unify Rules packaging in Rust for CI, include-zip, and release zips.
NSoiffer Aug 18, 2026
2e2c19c
Serialize rules unzip and YAML reads during parallel tests
NSoiffer Aug 18, 2026
5e899d7
update version number
NSoiffer Aug 18, 2026
04882d3
better speech for missing char used for parsing
NSoiffer Aug 18, 2026
25b472b
udate version #
NSoiffer Aug 18, 2026
67cc546
Add option --exclude to audit-translations
CristianCantoro Aug 19, 2026
3d267a0
Add tests for --exclude option
CristianCantoro Aug 19, 2026
0f4791c
Add test case IDs for CLI main exclude tests
moritz-gross Aug 19, 2026
c89adf4
Merge pull request #701 from CristianCantoro/audit-translations-exclude
moritz-gross Aug 19, 2026
512919a
fix minimized zip file so that flow style is used to reduce space
NSoiffer Aug 20, 2026
2355535
Merge branch 'main' of https://github.com/daisy/MathCAT
NSoiffer Aug 20, 2026
88856c9
fix test that depending on the details of YAML notation -- broke for …
NSoiffer Aug 20, 2026
728bbb7
fix row terminator for UEB in mtable
NSoiffer Aug 20, 2026
4a7f5ca
fix row terminator for UEB in mtable
NSoiffer Aug 20, 2026
18859bc
Bring over fixes to the minified yaml files.
NSoiffer Aug 20, 2026
4b9d19c
bump release number
NSoiffer Aug 20, 2026
eaa36e9
Fix #698 -- merge arc-like symbols under restricted condidtions
NSoiffer Aug 20, 2026
cf0b751
Update user guide
TimArborealis Aug 20, 2026
c7c25fa
Updated acknowledgements
TimArborealis Aug 21, 2026
76b3e59
fix #703
NSoiffer Aug 22, 2026
fc79ce9
Fix up UEB mtable notations.
NSoiffer Aug 22, 2026
c37aac5
Merge branch 'release-candidate'
NSoiffer Aug 22, 2026
baac528
Merge branch 'main' of https://github.com/daisy/MathCAT
NSoiffer Aug 22, 2026
1b32804
accidentally picked up wrong version # when merged in release-candidate
NSoiffer Aug 22, 2026
7ee9e3a
bump version #
NSoiffer Aug 22, 2026
f89080f
add Math4VIP to German translators
moritz-gross Aug 22, 2026
8931979
Merge pull request #713 from moritz-gross/main
moritz-gross Aug 22, 2026
88129be
Fix up arc look-alike chars due to canonicalize change.
NSoiffer Aug 23, 2026
6327bbd
Merge branch 'main' into French-Braille
NSoiffer Aug 23, 2026
6b980d1
Merge branch 'French-Braille'
NSoiffer Aug 23, 2026
9f8d81f
fixes no-unsafe branch clippy issues
NSoiffer Aug 25, 2026
4952dd7
Update MathCAT logo and add descriptive alt text. (#714)
ways2read Aug 27, 2026
1172c4d
fix clippy warning with new version of rust
NSoiffer Aug 28, 2026
e54a29f
Merge branch 'release-candidate'
NSoiffer Aug 28, 2026
70ef046
Merge branch 'main' of github.com:daisy/MathCAT
NSoiffer Aug 28, 2026
5a4aa2c
tried to align the MathCAT logo with the following text.
NSoiffer Aug 28, 2026
ed724d1
Add logo-inline.png for README and GitHub Pages docs
NSoiffer Aug 28, 2026
49bb57d
Cred to Greek translators
TimArborealis Sep 1, 2026
0932ffb
Fix outdated MathCAT project URLs (#732)
k4its1t Sep 2, 2026
72e2b1d
Add Brazilian Portuguese (pt) translation- #729 (#736)
natalieac03 Sep 2, 2026
aaad746
Release candidate (#743)
NSoiffer Sep 2, 2026
9ea98c2
pl: fix five speech/navigation defects and catch up with recent en ch…
michaldziwisz Sep 2, 2026
df565e2
pl: inflect unit names according to the numeral, not with an English …
michaldziwisz Sep 3, 2026
9f4721a
pl: speak the unit after "na" in the accusative, not the nominative (…
michaldziwisz Sep 3, 2026
6a5170a
Update: Add `Cargo.lock` file to track dependencies
moritz-gross Sep 3, 2026
8ac56dd
Merge pull request #750 from moritz-gross/remove-cargo-lock-for-gitig…
moritz-gross Sep 5, 2026
a6b6af1
Minor chemistry fix in Swedish
TimArborealis Sep 7, 2026
bd03fcd
pl: mark the unicode translations as verified (t -> T) (#741)
michaldziwisz Sep 7, 2026
e199081
add PauseFactor to test initialization so that local changes don't af…
NSoiffer Sep 8, 2026
d3b7970
Fix pica unit parsing in spacing width conversion (#755)
moritz-gross Sep 8, 2026
0714929
Update chemistry.rs
TimArborealis Sep 8, 2026
d5d1933
Fix "TEMP NAME of" when a parenthesized matrix is raised to a power (…
wittjeff Sep 13, 2026
8ef6ee1
Fix typo in fallback
NSoiffer Sep 15, 2026
87f4c59
The word "of" was hard-coded into intents. This moves its value to de…
NSoiffer Sep 15, 2026
a74a6e2
remove value used in debugging
NSoiffer Sep 15, 2026
2622ee5
Fix audit-ignore rule scoping
Kostenkov-2021 Sep 19, 2026
a6e65c8
Add in-memory virtual filesystem support to shim_filesystem (#760)
dtsengchromium Sep 19, 2026
49de6d6
Refactor: Simplify match return logic and improve string interpolatio…
moritz-gross Sep 19, 2026
3896006
Merge branch 'daisy:main' into main
Kostenkov-2021 Sep 19, 2026
5c8117e
de, el: use $CommandOffset instead of string-length($Prefix) in navig…
michaldziwisz Sep 20, 2026
97785d8
Merge branch 'daisy:main' into main
Kostenkov-2021 Sep 20, 2026
600180b
Fix audit-ignore parsing around comments
Kostenkov-2021 Sep 20, 2026
374ea58
Merge pull request #777 from Kostenkov-2021/main
moritz-gross Sep 20, 2026
7f3e79d
add tests for intervals in German
moritz-gross Sep 21, 2026
f1895d9
Refine German interval descriptions and update translation rules
moritz-gross Sep 21, 2026
322d7d6
Merge pull request #784 from moritz-gross/fix-intervals-german
moritz-gross Sep 21, 2026
ee539f2
Add German ClearSpeak rule and tests for pause intent
moritz-gross Sep 21, 2026
b2bf819
Merge pull request #785 from moritz-gross/add-pause-rule-to-German
moritz-gross Sep 21, 2026
21fd1eb
Add German localization for currency symbol placement and correspondi…
moritz-gross Sep 22, 2026
327d988
add another test for euro
moritz-gross Sep 22, 2026
a4083ce
add another test for pound/pfund
moritz-gross Sep 22, 2026
4e906f0
Merge pull request #786 from moritz-gross/fix-currency-order-in-German
moritz-gross Sep 22, 2026
692343a
Update German ClearSpeak rules: Add support for principal logarithm (…
moritz-gross Sep 22, 2026
b8d3116
Merge pull request #787 from moritz-gross/add-principal-value-log-for…
moritz-gross Sep 22, 2026
25059dd
Refine German ClearSpeak fraction translations and update ordinal fra…
moritz-gross Sep 22, 2026
5f08dc0
Merge pull request #788 from moritz-gross/German-add-rest-of-NumbersO…
moritz-gross Sep 22, 2026
5df8e81
German ClearSpeak: subset & superset
moritz-gross Sep 22, 2026
fd8153d
Merge pull request #790 from moritz-gross/de-ClearSpeak-superset-subset
moritz-gross Sep 22, 2026
88404bf
de: fix chemical state names
moritz-gross Sep 22, 2026
8efb7ee
Merge pull request #791 from moritz-gross/de--fix-vocab-for-chemical-…
moritz-gross Sep 22, 2026
c17671c
de: fix chemical reaction arrow
moritz-gross Sep 22, 2026
771dc68
de: fix integer exponentiation
moritz-gross Sep 22, 2026
c6a33fa
de: fix exponentiation by arbitrary exponents
moritz-gross Sep 22, 2026
6f24b27
de: add vector norm
moritz-gross Sep 22, 2026
11736b5
de: fix "transpose"
moritz-gross Sep 22, 2026
bb775c5
replace lamda with lambda (#789)
moritz-gross Sep 22, 2026
24eaee3
fix(pl): przywróć szablony sum i iloczynów po naprawie słowa łącząceg…
michaldziwisz Sep 22, 2026
e46e7db
Refactor/simplify prefs rs (#780)
moritz-gross Sep 22, 2026
8ef55c4
ci: add scheduled workflow to alert translators of English rule changes
Johannes-spsm Sep 8, 2026
1af0b43
Add comment to cron schedule in translator-alert.yml
moritz-gross Sep 9, 2026
6172909
de: fix "k-th root"
moritz-gross Sep 22, 2026
71f2f8a
de: fix "negativ positiv"
moritz-gross Sep 22, 2026
8ebda89
de: fix RPM singular/plural
moritz-gross Sep 22, 2026
32d7a9c
Set CRLF line endings for .rs and .yaml files
moritz-gross Sep 22, 2026
7c7f9b5
Add support for stdin, inline MathML, and default fallback
moritz-gross Sep 22, 2026
a8f2e3c
Re-add addon info to user guide
TimArborealis Sep 23, 2026
709b716
Add rule order checks and reporting for shared rule mismatches
moritz-gross Sep 23, 2026
e42aec2
fix ruff
moritz-gross Sep 23, 2026
16a830d
uv run ruff format audit_translations/
moritz-gross Sep 23, 2026
fc7d939
Refactor: Replace custom path utilities with `Path` API and update zi…
moritz-gross Sep 24, 2026
e79dda7
Refactor navigation state management: unify position and command stac…
moritz-gross Sep 24, 2026
c113028
simplify `read_prefs_file` (#808)
moritz-gross Sep 24, 2026
7764ea6
Replace `unwrap()` with `let Some(...) else` constructs for safer opt…
moritz-gross Sep 23, 2026
2b80113
simplify destructuring syntax using tuples
moritz-gross Sep 24, 2026
824cdda
use elements.rs as chemistry database
moritz-gross Sep 20, 2026
d22ed4d
fix redundant call of pref_to_string (#815)
moritz-gross Sep 25, 2026
ad0e716
clean up unused types in definitions and remove outdated docstring (#…
moritz-gross Sep 25, 2026
414a7df
remove dead functions set_string_value and set_bool_value (#819)
moritz-gross Sep 25, 2026
307109f
replace custom constructor with struct literals for TTSCommandRule (#…
moritz-gross Sep 25, 2026
5c5286b
ru: use explicit "множество" for standard number sets
Kostenkov-2021 Sep 25, 2026
a1b1c8c
Refine Russian math terminology
Kostenkov-2021 Sep 25, 2026
fc200d0
Fix Russian overline terminology
Kostenkov-2021 Sep 25, 2026
6146645
Add GitHub Actions workflows to measure and report library size changes
moritz-gross Sep 26, 2026
89d018b
Refactor library size comment script to improve readability and error…
moritz-gross Sep 26, 2026
aab967c
Update README with supported and in-progress speech languages list
moritz-gross Sep 23, 2026
3bbbd44
replace buggy Display implementation for Pronounce with Debug trait (…
moritz-gross Sep 27, 2026
429cf07
define ratio (U+2236)
NSoiffer Sep 28, 2026
f2f3ebc
ru: improve norms, overlines, multiline & operators
Kostenkov-2021 Sep 29, 2026
71f208c
added/modified comments for functions that deal with function names a…
NSoiffer Sep 29, 2026
5ad3987
Swap IntentMappings so ":" is argument glue and "|" is verbosity -- t…
NSoiffer Sep 30, 2026
762d492
shorten 'ratio' def after debugging
NSoiffer Sep 30, 2026
a3de867
fix clippy warnings (about comments)
NSoiffer Sep 30, 2026
e1692f0
Normalize tracked files to match .gitattributes (#843)
moritz-gross Sep 30, 2026
18f1cf9
Create rule coverage functionality (#834) (#845)
moritz-gross Oct 1, 2026
05e32aa
Improve Russian math speech rules
Kostenkov-2021 Oct 5, 2026
cbf0d94
Merge upstream main into ru and resolve PR 798 conflicts
Kostenkov-2021 Oct 5, 2026
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
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*.rs]
end_of_line = crlf

[*.yaml]
end_of_line = crlf
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.rs text eol=crlf
*.yaml text eol=crlf
7 changes: 7 additions & 0 deletions .github/translator-alert.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Add your GitHub username (including '@') to the 'notify' list to receive alerts when English rules change.
# Append to the existing list on the same line, separated by a single space (e.g. notify=@user1 @user2).
# You do not have to add your Github username if you are already in the mathcat-translators group.

paths=Rules/Languages/en/
exclude=Rules/Languages/en/gb/
notify=@johannes-spsm @daisy/mathcat-translators
119 changes: 119 additions & 0 deletions .github/workflows/library-size-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Library Size Comment

on:
workflow_run:
workflows: [Library Size]
types: [completed]

permissions:
actions: read
pull-requests: write

concurrency:
group: library-size-comment-${{ github.event.workflow_run.head_repository.id }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false

jobs:
comment:
name: Update PR comment
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-24.04
steps:
- name: Download measurements
uses: actions/download-artifact@v8
with:
name: library-size-report
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: ${{ runner.temp }}/mathcat-size-report

# This job never checks out or executes PR code. Treat the downloaded report as untrusted.
- name: Update size comment
uses: actions/github-script@v9
env:
REPORT_PATH: ${{ runner.temp }}/mathcat-size-report/report.json
with:
script: |
const fs = require('fs');
const run = context.payload.workflow_run;
const {owner, repo} = context.repo;
const marker = '<!-- mathcat-library-size -->';

// Read and validate the artifact from the untrusted PR build.
function readReport() {
const report = JSON.parse(fs.readFileSync(process.env.REPORT_PATH, 'utf8'));
const shaPattern = /^[0-9a-f]{40}$/i;
if (!Number.isSafeInteger(report.prNumber) || report.prNumber <= 0 ||
!shaPattern.test(report.baseSha) || !shaPattern.test(report.headSha) ||
!Number.isSafeInteger(report.baseBytes) || report.baseBytes <= 0 ||
!Number.isSafeInteger(report.headBytes) || report.headBytes <= 0) {
throw new Error('Invalid library size report');
}
return report;
}

// Only report measurements for the current PR and source branch.
async function matchesCurrentPull(report) {
const {data: pull} = await github.rest.pulls.get({
owner, repo, pull_number: report.prNumber,
});
if (pull.state !== 'open' || pull.base.sha !== report.baseSha ||
pull.head.sha !== report.headSha) {
core.notice('PR revisions changed or PR closed; ignoring stale measurements');
return false;
}
if (run.head_repository?.id !== pull.head.repo?.id ||
run.head_branch !== pull.head.ref ||
(run.pull_requests?.length > 0 &&
!run.pull_requests.some(pr => pr.number === report.prNumber))) {
throw new Error('Report does not belong to the triggering PR branch');
}
return true;
}

// The summary is the entire collapsed view; the table is shown on expansion.
function renderComment(report) {
const mib = bytes => `${(bytes / 1048576).toFixed(2)} MiB`;
const size = bytes => `${mib(bytes)} (${bytes.toLocaleString('en-US')} bytes)`;
const delta = report.headBytes - report.baseBytes;
const percent = `${delta > 0 ? '+' : ''}${(100 * delta / report.baseBytes).toFixed(2)}%`;
return [
marker,
'<details>',
`<summary>Linux library size: ${mib(report.headBytes)} (${percent})</summary>`,
'',
'| Revision | Release `liblibmathcat.so` |',
'| --- | ---: |',
`| Base (${report.baseSha.slice(0, 7)}) | ${size(report.baseBytes)} |`,
`| PR (${report.headSha.slice(0, 7)}) | ${size(report.headBytes)} |`,
`| Change | ${delta > 0 ? '+' : ''}${delta.toLocaleString('en-US')} bytes (${percent}) |`,
'',
`Built with default features, Rust 1.96.0, and Ubuntu 24.04. [Workflow run](${run.html_url}).`,
'</details>',
].join('\n');
}

// Reuse the bot's marked comment instead of posting on every run.
async function upsertComment(prNumber, body) {
const comments = await github.paginate(github.rest.issues.listComments, {
owner, repo, issue_number: prNumber, per_page: 100,
});
const previous = comments.find(comment =>
comment.user?.login === 'github-actions[bot]' && comment.body?.includes(marker));
if (previous) {
if (previous.body !== body) {
await github.rest.issues.updateComment({
owner, repo, comment_id: previous.id, body,
});
}
} else {
await github.rest.issues.createComment({
owner, repo, issue_number: prNumber, body,
});
}
}

const report = readReport();
if (await matchesCurrentPull(report)) {
await upsertComment(report.prNumber, renderComment(report));
}
83 changes: 83 additions & 0 deletions .github/workflows/library-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Library Size

on: pull_request

permissions:
contents: read

concurrency:
group: library-size-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
measure:
name: Measure Linux shared library
runs-on: ubuntu-24.04
steps:
- name: Check out base revision
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.base.sha }}
path: base
persist-credentials: false

- name: Check out PR revision
uses: actions/checkout@v5
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
path: head
persist-credentials: false

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.96.0

- name: Build base library
id: base
working-directory: base
env:
CARGO_TARGET_DIR: ${{ runner.temp }}/mathcat-size-base-target
run: |
cargo build --release --lib --locked
bytes=$(stat -c%s "$CARGO_TARGET_DIR/release/liblibmathcat.so")
echo "bytes=$bytes" >> "$GITHUB_OUTPUT"

- name: Build PR library
id: head
working-directory: head
env:
CARGO_TARGET_DIR: ${{ runner.temp }}/mathcat-size-head-target
run: |
cargo build --release --lib --locked
bytes=$(stat -c%s "$CARGO_TARGET_DIR/release/liblibmathcat.so")
echo "bytes=$bytes" >> "$GITHUB_OUTPUT"

- name: Save measurements
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BASE_BYTES: ${{ steps.base.outputs.bytes }}
HEAD_BYTES: ${{ steps.head.outputs.bytes }}
REPORT_DIR: ${{ runner.temp }}/mathcat-size-report
run: |
mkdir -p "$REPORT_DIR"
node - <<'NODE'
const fs = require('fs');
const path = require('path');
const report = {
prNumber: Number(process.env.PR_NUMBER),
baseSha: process.env.BASE_SHA,
headSha: process.env.HEAD_SHA,
baseBytes: Number(process.env.BASE_BYTES),
headBytes: Number(process.env.HEAD_BYTES),
};
fs.writeFileSync(path.join(process.env.REPORT_DIR, 'report.json'), JSON.stringify(report));
NODE

- name: Upload measurements
uses: actions/upload-artifact@v7
with:
name: library-size-report
path: ${{ runner.temp }}/mathcat-size-report/report.json
retention-days: 1
Loading
Loading