Small fixes to parser & CLI. Also renamed and moved a bunch around #132
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Performance and size | |
on: | |
push: | |
branches: [main, fixes271] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
run-benchmarks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: brndnmtthws/rust-action-cargo-binstall@v1 | |
with: | |
packages: hyperfine | |
- name: Build Ezno | |
run: cargo build --release | |
env: | |
CARGO_PROFILE_RELEASE_DEBUG: true | |
- name: Download files | |
run: | | |
curl https://esm.sh/v128/[email protected]/es2022/react-dom.mjs > react.js | |
- name: Run checker performance | |
shell: bash | |
run: | | |
# Generate a file which contains everything that Ezno currently implements | |
cargo run -p ezno-parser --example code_blocks_to_script ./checker/specification/specification.md demo.ts | |
echo "<details> | |
<summary>Input</summary> | |
\`\`\`ts | |
" >> $GITHUB_STEP_SUMMARY | |
cat demo.ts >> $GITHUB_STEP_SUMMARY | |
echo -e "\`\`\`\n</details>" >> $GITHUB_STEP_SUMMARY | |
NO_COLOR=1 | |
echo "<details> | |
<summary>Diagnostics</summary> | |
\`\`\`shell" >> $GITHUB_STEP_SUMMARY | |
./target/release/ezno check demo.ts &>> $GITHUB_STEP_SUMMARY | |
echo -e "\`\`\`\n</details>" >> $GITHUB_STEP_SUMMARY | |
echo -e "### Checking\n\`\`\`shell" >> $GITHUB_STEP_SUMMARY | |
hyperfine './target/release/ezno check demo.ts' >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
- name: Run parser, minfier/stringer performance | |
shell: bash | |
run: | | |
curl https://esm.sh/v128/[email protected]/es2022/react-dom.mjs > react.js | |
echo "### Parsing and minifying `react-dom`">> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`shell">> $GITHUB_STEP_SUMMARY | |
hyperfine './target/release/ezno ast-explorer --file react.js uglifier' >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
- name: Print (linux) binary size | |
run: | | |
echo "Binary is $(stat -c %s ./target/release/ezno) bytes" >> $GITHUB_STEP_SUMMARY |