chore: split Github Actions workflows

This commit is contained in:
Harttle
2023-06-05 23:32:35 +08:00
committed by Jun Yang
parent 495bef2d0c
commit e401a30972
21 changed files with 304 additions and 108 deletions
+17 -25
View File
@@ -16,14 +16,14 @@
- Ensure the build runs because the Husky pre-commit hook checks it
- `npm run check` checks runs the build, tests, lint and perf tests
- `commitlint` checks the commit message format
If there is a problem you will see it in the pre-commit hook output.
In VS Code, this output will be shown in a new file in a new tab if the
pre-commit hook fails.
If you want to check the commit message without using the VS Code Source
Control UI, you can run `echo "feat: my commit message" > npx commitlint`
directly.
- `git switch -c your_branch_name` (do this in your fork not the main repo)
- `git add .`
- `git commit -m "feat: Adding my change"`
@@ -33,32 +33,24 @@
## Playground
The Playground runs off the `docs` directory.
`npm run:docs` is used to build it and that's included in `npm run build`.
`npm run build:docs` is used to build it.
To start the site locally, go to `docs` and run `npm start`, then visit
Then, to start the site locally, go to `docs` and run `npm start`, then visit
http://localhost:4000/playground.html.
At the moment, the Playground uses the latest NPM version of the LiquidJS
library instead of using the built artifact produced by `npm run build:dist`
(also included in `npm run build`).
The Playground uses a local built LiquidJS, which is created during `npm run build:docs`.
To update that, you'll need to run `./bin/build-docs-liquid.sh` each time after making changes.
Then refresh the Playground site for the changes to take effect.
To use the Playground with the local build of the library, make these changes:
## Performance
- Copy `dist/liquid.browser.min.js` to `docs/public/js/liquid.browser.min.js`
- Open `docs/themes/navy/layout/partial/after_footer.swig`
- Remove `https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js` line
- Add `{{ js('liquid.browser.min.js') }}` line before `{{ js('js/main') }}` line
- Refresh the Playground site for the changes to take effect
- Replace `liquid.browser.min.js` each time after making changes and building
If your change can have a performance impact, you can update and run performance cases under `benchmark/`.
```diff
{% if page.layout === 'playground' %}
-<script src="https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/src-min/ace.js"></script>
{% endif %}
+{{ js('js/liquid.browser.min.js') }}
{{ js('js/main') }}
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
```
1. `npm run build:cjs` to build a CommonJS bundle for the perf test.
2. `npm run perf:diff` to check whether there's a regression compared against `liquidjs@latest`
Further more, `benchmark/` contains different cases to check its ops/sec. Useful when debugging perf regressions, to use it:
- `cd benchmark` go into benchmark project
- `npm ci` install dependencies
- `npm start` run the cases