Skip to content

Commit

Permalink
Improve local development script
Browse files Browse the repository at this point in the history
- Avoid running `npm install` on every execution
- Add a separate `install` task that runs `npm clean-install`
  • Loading branch information
bigdaz committed Nov 15, 2024
1 parent f4845d2 commit 0e27ea7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
The `build` script in the project root provides a convenient way to perform many local build tasks:
1. `./build` will lint and compile typescript sources
2. `./build all` will lint and compile typescript and run unit tests
3. `./build init-scripts` will run the init-script integration tests
4. `./build act <act-commands>` will run `act` after building local changes (see below)
3. `./build install` will install npm packages followed by lint and compile
4. `./build init-scripts` will run the init-script integration tests
5. `./build act <act-commands>` will run `act` after building local changes (see below)

## Using `act` to run integ-test workflows locally

Expand Down
15 changes: 8 additions & 7 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ cd sources

case "$1" in
all)
npm clean-install
npm run all
;;
act)
# Build and copy outputs to the dist directory
npm install
npm run build
cd ..
cp -r sources/dist .
Expand All @@ -18,18 +16,21 @@ case "$1" in
# Revert the changes to the dist directory
git checkout -- dist
;;
dist)
npm clean-install
npm run build
cd ..
cp -r sources/dist .
;;
init-scripts)
cd test/init-scripts
./gradlew check
;;
dist)
npm install
install)
npm clean-install
npm run build
cd ..
cp -r sources/dist .
;;
*)
npm install
npm run build
;;
esac

0 comments on commit 0e27ea7

Please sign in to comment.