Unverified Commit 0e27ea7e authored by daz's avatar daz
Browse files

Improve local development script

- Avoid running `npm install` on every execution
- Add a separate `install` task that runs `npm clean-install`
parent f4845d28
Loading
Loading
Loading
Loading
+3 −2
Changes for CONTRIBUTING.md: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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

+8 −7
Changes for build: 8 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -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 .
@@ -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