forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: yarn build cache trying things out #2
Signed-off-by: Peter Somogyvari <[email protected]>
- Loading branch information
Showing
17 changed files
with
345 additions
and
383 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
"reset:git": "git clean -f -X", | ||
"reset:yarn-lock": "yarn run init-registries && yarn install --update-checksums --force", | ||
"reset": "run-s reset:git reset:node-modules reset:yarn-lock configure", | ||
"configure": "npm run init-registries && yarn install --mode=skip-build && yarn build:dev:backend", | ||
"configure": "npm run init-registries && yarn install && yarn build:dev:backend", | ||
"install-yarn": "npm install --global [email protected]", | ||
"set-yarn-version": "yarn set version stable", | ||
"enable-corepack": "npm i -g corepack && corepack enable && corepack prepare [email protected] --activate", | ||
|
@@ -264,36 +264,5 @@ | |
"web3-shh": { | ||
"built": false | ||
} | ||
}, | ||
"peerDependenciesMeta": { | ||
"@apollo/protobufjs": {}, | ||
"@nestjs/core": {}, | ||
"@openapitools/openapi-generator-cli": {}, | ||
"@trufflesuite/bigint-buffer": {}, | ||
"aws-sdk": {}, | ||
"bufferutil": {}, | ||
"cbor": {}, | ||
"classic-level": {}, | ||
"core-js": {}, | ||
"cpu-features": {}, | ||
"deasync": {}, | ||
"electron": {}, | ||
"es5-ext": {}, | ||
"esbuild": {}, | ||
"iso-constants": {}, | ||
"keccak": {}, | ||
"keytar": {}, | ||
"leveldown": {}, | ||
"nice-napi": {}, | ||
"pkcs11js": {}, | ||
"protobufjs": {}, | ||
"secp256k1": {}, | ||
"sqlite3": {}, | ||
"ssh2": {}, | ||
"truffle": {}, | ||
"utf-8-validate": {}, | ||
"web3": {}, | ||
"web3-bzz": {}, | ||
"web3-shh": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...us-plugin-ledger-connector-fabric/src/test/typescript/integration/identity-client.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,12 +52,34 @@ function checkOnlyDocumentation() | |
ENDED_AT=`date +%s` | ||
runtime=$((ENDED_AT-STARTED_AT)) | ||
echo "$(date +%FT%T%z) [CI] SUCCESS - runtime=$runtime seconds." | ||
checkWorkTreeStatus | ||
exit 0 | ||
fi | ||
done | ||
} | ||
|
||
function freeUpGitHubRunnerDiskSpace() { | ||
# If we are running in a GitHub Actions runner, then free up 30 GB space by | ||
# removing things we do not need such as the Android SDK and .NET. | ||
# | ||
# Huge thanks to Maxim Lobanov for the advice: | ||
# https://github.com/actions/virtual-environments/issues/2606#issuecomment-772683150 | ||
# | ||
# Why do this? Because we've been getting warnings about the runners being | ||
# left with less than a hundred megabytes of disk space during the tests. | ||
# | ||
# This operation takes about 2 minutes to do and so is disabled by default to get better | ||
# performance from the CI by default. It can be enabled on a per job basis via | ||
# the env variables defined in the action's .yaml files. | ||
# | ||
if [ "${FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED:-true}" = "true" ]; then | ||
echo "$(date +%FT%T%z) [CI] Freeing up GitHub Action Runner disk space disabled. Skipping..." | ||
else | ||
echo "$(date +%FT%T%z) [CI] Freeing up GitHub Action Runner disk space by deleting Android and .NET ..." | ||
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android | ||
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET | ||
fi | ||
} | ||
|
||
function mainTask() | ||
{ | ||
set -euxo pipefail | ||
|
@@ -83,46 +105,31 @@ function mainTask() | |
# Check if the modified files are only for documentation. | ||
checkOnlyDocumentation | ||
|
||
# If we are running in a GitHub Actions runner, then free up 30 GB space by | ||
# removing things we do not need such as the Android SDK and .NET. | ||
# | ||
# Huge thanks to Maxim Lobanov for the advice: | ||
# https://github.com/actions/virtual-environments/issues/2606#issuecomment-772683150 | ||
# | ||
# Why do this? Because we've been getting warnings about the runners being | ||
# left with less than a hundred megabytes of disk space during the tests. | ||
if [ "${GITHUB_ACTIONS:-false}" = "true" ]; then | ||
echo 'Detected GitHub Action Runner deleting Android and .NET ...' | ||
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android | ||
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET | ||
fi | ||
# Can be turned ON/OFF via env var FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED=true/false | ||
freeUpGitHubRunnerDiskSpace | ||
|
||
dumpDiskUsageInfo | ||
if [ "${DUMP_DISK_USAGE_INFO_DISABLED:-true}" = "true" ]; then | ||
echo "$(date +%FT%T%z) [CI] dumpDiskUsageInfo disabled. Skipping..." | ||
else | ||
dumpDiskUsageInfo | ||
fi | ||
|
||
docker --version | ||
docker-compose --version | ||
node --version | ||
npm --version | ||
java -version | ||
|
||
# install npm 7 globally - needed because Node v12, v14 default to npm v6 | ||
npm install -g [email protected] | ||
npm --version | ||
yarn --version | ||
|
||
export NODE_OPTIONS=--max_old_space_size=5120 | ||
|
||
### COMMON | ||
cd $PROJECT_ROOT_DIR | ||
|
||
npm run configure | ||
|
||
# Obtains the major NodeJS version such as "12" from "v12.14.1" | ||
# We only run the custom checks above v12 because the globby dependency's | ||
# latest version is forcing us to use Ecmascript Modules which do not work | ||
# on NodeJS 12 even with the additional flags passed in. | ||
nodejs_version=`node --version | awk -v range=1 '{print substr($0,range+1,2)}'` | ||
if [ "$nodejs_version" -gt "12" ]; then | ||
echo "$(date +%FT%T%z) [CI] NodeJS is newer than v12, running custom checks..." | ||
yarn run custom-checks | ||
if [ "${CONFIGURE_DISABLED:-false}" = "true" ]; then | ||
echo "$(date +%FT%T%z) [CI] npm run configure disabled. Skipping..." | ||
else | ||
npm run configure | ||
fi | ||
|
||
if [ "${TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED:-false}" = "true" ]; then | ||
|
@@ -143,18 +150,23 @@ function mainTask() | |
yarn test:jest:all $JEST_TEST_PATTERN | ||
fi | ||
|
||
dumpDiskUsageInfo | ||
if [ "${DUMP_DISK_USAGE_INFO_DISABLED:-true}" = "true" ]; then | ||
echo "$(date +%FT%T%z) [CI] dumpDiskUsageInfo disabled. Skipping..." | ||
else | ||
dumpDiskUsageInfo | ||
fi | ||
|
||
if [ "${TAPE_TEST_RUNNER_DISABLED:-false}" = "true" ]; then | ||
echo "$(date +%FT%T%z) [CI] Tape test runner disabled. Skipping..." | ||
else | ||
yarn test:tap:all --bail $TAPE_TEST_PATTERN | ||
fi | ||
|
||
dumpDiskUsageInfo | ||
|
||
# The webpack production build needs more memory than the default allocation | ||
export NODE_OPTIONS=--max_old_space_size=4096 | ||
if [ "${DUMP_DISK_USAGE_INFO_DISABLED:-true}" = "true" ]; then | ||
echo "$(date +%FT%T%z) [CI] dumpDiskUsageInfo disabled. Skipping..." | ||
else | ||
dumpDiskUsageInfo | ||
fi | ||
|
||
# We run the full build last because the tests don't need it so in the interest | ||
# of providing feedback about failing tests as early as possible we run the | ||
|
@@ -166,10 +178,15 @@ function mainTask() | |
yarn run build | ||
fi | ||
|
||
if [ "${CHECK_WORK_TREE_STATUS_DISABLED:-true}" = "true" ]; then | ||
echo "$(date +%FT%T%z) [CI] checkWorkTreeStatus disabled. Skipping..." | ||
else | ||
checkWorkTreeStatus | ||
fi | ||
|
||
ENDED_AT=`date +%s` | ||
runtime=$((ENDED_AT-STARTED_AT)) | ||
echo "$(date +%FT%T%z) [CI] SUCCESS - runtime=$runtime seconds." | ||
checkWorkTreeStatus | ||
exit 0 | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters