diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f2f2d9..6336524 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,11 @@ +## Building + +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 ` will run `act` after building local changes (see below) + ## How to merge a Dependabot PR The "distribution" for a GitHub Action is checked into the repository itself. @@ -22,10 +30,10 @@ test local changes without pushing to a branch. This feature is most useful to run a single `integ-test-*` workflow. Avoid running `ci-quick-test` or other aggregating workflows unless you want to use your local machine as a heater! Example running a single workflow: -`act -W .github/workflows/integ-test-caching-config.yml` +`./build act -W .github/workflows/integ-test-caching-config.yml` Example running a single job: -`act -W .github/workflows/integ-test-caching-config.yml -j cache-disabled-pre-existing-gradle-home` +`./build act -W .github/workflows/integ-test-caching-config.yml -j cache-disabled-pre-existing-gradle-home` Known issues: - `integ-test-cache-cleanup.yml` fails because `gradle` is not installed on the runner. Should be fixed by #33. diff --git a/build b/build index eb576c6..d768a70 100755 --- a/build +++ b/build @@ -1,14 +1,15 @@ #!/bin/bash cd sources -npm install case "$1" in all) + npm clean-install nprm run all ;; act) # Build and copy outputs to the dist directory + npm install npm run build cd .. cp -r sources/dist . @@ -17,7 +18,12 @@ case "$1" in # Revert the changes to the dist directory git co -- dist ;; + init-scripts) + cd test/init-scripts + ./gradlew check + ;; *) + npm install npm run build ;; esac \ No newline at end of file