From 994359a2ebbc3e32adfc9c8b8b16c9416667d6f1 Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 24 Aug 2022 16:37:08 -0400 Subject: [PATCH 1/3] save Go build/test cache after tests complete --- .circleci/config.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a37f46c814..1ab5f756a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -227,13 +227,17 @@ commands: - prepare_go - restore_libsodium - restore_cache: + name: Restoring Go source cache keys: - 'go-mod-1.17.9-v4-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}' - restore_cache: + name: Restoring Go build/test cache keys: - - 'go-cache-v4-{{ arch }}-{{ .Branch }}-{{ .Revision }}' - - 'go-cache-v4-{{ arch }}-{{ .Branch }}-' - - 'go-cache-v4-{{ arch }}-' + - go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_NODE_INDEX }} + - go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }} + - go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}- + - go-cache-v5-{{ arch }}-{{ .Branch }}- + - go-cache-v5-{{ arch }}-master- - run: name: scripts/travis/build.sh --make_debug command: | @@ -246,13 +250,10 @@ commands: scripts/travis/build.sh --make_debug - cache_libsodium - save_cache: + name: Saving Go source cache key: 'go-mod-1.17.9-v4-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}' paths: - << parameters.build_dir >>/go/pkg/mod - - save_cache: - key: 'go-cache-v4-{{ arch }}-{{ .Branch }}-{{ .Revision }}' - paths: - - tmp/go-cache cache_libsodium: description: Cache libsodium for build @@ -325,6 +326,11 @@ commands: export PARTITION_TOTAL=${CIRCLE_NODE_TOTAL} export PARTITION_ID=${CIRCLE_NODE_INDEX} gotestsum --format standard-verbose --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES + - save_cache: + name: Saving Go build/test cache + key: go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_NODE_INDEX }} + paths: + - tmp/go-cache - store_artifacts: path: << parameters.result_path >> destination: test-results From 6a1b130e3d52da26ad4f36d03f8c684ed602bb24 Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 24 Aug 2022 17:47:29 -0400 Subject: [PATCH 2/3] change that does not modify Go code --- .circleci/config.yml | 2 ++ .github/workflows/build.yml | 3 +++ .github/workflows/codegen_verification.yml | 3 +++ .github/workflows/reviewdog.yml | 3 +++ 4 files changed, 11 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa74cc6b7d..8f906ecf1d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -272,6 +272,7 @@ commands: mkdir -p tmp find crypto/libsodium-fork -type f -exec openssl md5 "{}" + > tmp/libsodium.md5 - save_cache: + name: Save cached libsodium build key: 'libsodium-fork-v4-{{ arch }}-{{ checksum "tmp/libsodium.md5" }}' paths: - crypto/libs @@ -285,6 +286,7 @@ commands: mkdir -p tmp find crypto/libsodium-fork -type f -exec openssl md5 "{}" + > tmp/libsodium.md5 - restore_cache: + name: Restore cached libsodium build keys: - 'libsodium-fork-v4-{{ arch }}-{{ checksum "tmp/libsodium.md5" }}' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3936f76c22..58b4627236 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,8 @@ name: "Build Windows" on: + push: + branches: + - master pull_request: jobs: build-windows: diff --git a/.github/workflows/codegen_verification.yml b/.github/workflows/codegen_verification.yml index cff22d11d4..cdeed288b9 100644 --- a/.github/workflows/codegen_verification.yml +++ b/.github/workflows/codegen_verification.yml @@ -1,5 +1,8 @@ name: "codegen verification" on: + push: + branches: + - master pull_request: jobs: codegen_verification: diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 52ec1fa9b3..736b8a6bcf 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -1,5 +1,8 @@ name: "ReviewDog workflow" on: + push: + branches: + - master pull_request: jobs: # Blocking Errors Section From 9e87a11cbe9ab75e5cfe1267512c78afa222993b Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 24 Aug 2022 21:50:38 -0400 Subject: [PATCH 3/3] optimize caches --- .circleci/config.yml | 52 ++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8f906ecf1d..110372ce8e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -234,18 +234,7 @@ commands: - checkout - prepare_go - restore_libsodium - - restore_cache: - name: Restoring Go source cache - keys: - - 'go-mod-1.17.13-v4-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}' - - restore_cache: - name: Restoring Go build/test cache - keys: - - go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_NODE_INDEX }} - - go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }} - - go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}- - - go-cache-v5-{{ arch }}-{{ .Branch }}- - - go-cache-v5-{{ arch }}-master- + - restore_go_caches - run: name: scripts/travis/build.sh --make_debug command: | @@ -257,11 +246,41 @@ commands: export GIMME_VERSION_PREFIX=<< parameters.build_dir >>/.gimme/versions scripts/travis/build.sh --make_debug - cache_libsodium + - save_go_caches + + save_go_caches: + description: Cache Go source and build caches + parameters: + build_dir: + type: string + default: << pipeline.parameters.build_dir >> + steps: - save_cache: - name: Saving Go source cache - key: 'go-mod-1.17.13-v4-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}' + name: Saving Go mod source cache + key: go-mod-v5-{{ .Branch }}-{{ checksum "go.sum" }} paths: - << parameters.build_dir >>/go/pkg/mod + - save_cache: + name: Saving Go build cache + key: go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }} + paths: + - tmp/go-cache + + restore_go_caches: + description: Restore Go source and build caches + steps: + - restore_cache: + name: Restoring Go mod source cache + keys: + - go-mod-v5-{{ .Branch }}-{{ checksum "go.sum" }} + - go-mod-v5-{{ .Branch }}- + - go-mod-v5-master- + - restore_cache: + name: Restoring Go build cache + keys: + - go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }} + - go-cache-v5-{{ arch }}-{{ .Branch }}- + - go-cache-v5-{{ arch }}-master- cache_libsodium: description: Cache libsodium for build @@ -336,11 +355,6 @@ commands: export PARTITION_TOTAL=${CIRCLE_NODE_TOTAL} export PARTITION_ID=${CIRCLE_NODE_INDEX} gotestsum --format standard-verbose --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES - - save_cache: - name: Saving Go build/test cache - key: go-cache-v5-{{ arch }}-{{ .Branch }}-{{ checksum "go.sum" }}-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLE_NODE_INDEX }} - paths: - - tmp/go-cache - store_artifacts: path: << parameters.result_path >> destination: test-results