Skip to content

Random fixes across the project (#90) #124

Random fixes across the project (#90)

Random fixes across the project (#90) #124

name: Performance and size
on:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
hyperfine:
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 -O https://gist.githubusercontent.com/kaleidawave/5dcb9ec03deef1161ebf0c9d6e4b88d8/raw/03156048e214af0ceee4005ba8b86f96690dcbb2/demo.ts > demo.ts
curl https://esm.sh/v128/react-dom@18.2.0/es2022/react-dom.mjs > react.js
- name: Run parser, minfier, stringer performance
shell: bash
run: |
curl https://esm.sh/v128/react-dom@18.2.0/es2022/react-dom.mjs > react.js
echo "### Hyperfine">> $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: Run checker performance
shell: bash
if: false
run: |
echo "### Output">> $GITHUB_STEP_SUMMARY
echo "\`\`\`shell">> $GITHUB_STEP_SUMMARY
./target/release/ezno check demo.ts >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "### Hyperfine">> $GITHUB_STEP_SUMMARY
echo "\`\`\`shell">> $GITHUB_STEP_SUMMARY
hyperfine './target/release/ezno check demo.ts' >> $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