From e6bd9a3c91e24a002a23bc9ec1507bf5fc544ac4 Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Wed, 24 Aug 2022 13:11:46 -0400 Subject: [PATCH] CI: make windows build faster (#4443) * use Go module caching (in setup-go@v3) and libsodium build caching * rename workflow * upgrade to 1.17.13 --- .circleci/config.yml | 6 +++--- .github/workflows/build.yml | 18 ++++++++++++------ .github/workflows/reviewdog.yml | 2 +- Makefile | 1 - scripts/get_golang_version.sh | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a37f46c814..ad68bfbbf6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -201,7 +201,7 @@ commands: shell: bash.exe command: | choco install -y msys2 pacman make wget --force - choco install -y golang --version=1.17.9 --force + choco install -y golang --version=1.17.13 --force choco install -y python3 --version=3.7.3 --force export msys2='cmd //C RefreshEnv.cmd ' export msys2+='& set MSYS=winsymlinks:nativestrict ' @@ -228,7 +228,7 @@ commands: - restore_libsodium - restore_cache: keys: - - 'go-mod-1.17.9-v4-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}' + - 'go-mod-1.17.13-v4-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}' - restore_cache: keys: - 'go-cache-v4-{{ arch }}-{{ .Branch }}-{{ .Revision }}' @@ -246,7 +246,7 @@ commands: scripts/travis/build.sh --make_debug - cache_libsodium - save_cache: - key: 'go-mod-1.17.9-v4-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}' + key: 'go-mod-1.17.13-v4-{{ arch }}-{{ checksum "go.mod" }}-{{ checksum "go.sum" }}' paths: - << parameters.build_dir >>/go/pkg/mod - save_cache: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 825056b1e1..3936f76c22 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,8 @@ -name: "Build workflow" +name: "Build Windows" on: pull_request: jobs: - build-test-windows: + build-windows: runs-on: windows-2022 defaults: run: @@ -14,14 +14,20 @@ jobs: update: true path-type: inherit - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install golang - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: '1.17.9' - - name: Build Test + go-version: "1.17.13" + - name: Restore libsodium from cache + id: cache-libsodium + uses: actions/cache@v3 + with: + path: crypto/libs + key: libsodium-fork-v2-${{ runner.os }}-${{ hashFiles('crypto/libsodium-fork/**') }} + - name: Build run: | export ALGORAND_DEADLOCK=enable export SKIP_GO_INSTALLATION=True diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index f84732e3d8..52ec1fa9b3 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -45,7 +45,7 @@ jobs: - name: Install specific golang uses: actions/setup-go@v2 with: - go-version: '1.17.9' + go-version: '1.17.13' - name: Create folders for golangci-lint run: mkdir -p cicdtmp/golangci-lint - name: Check if custom golangci-lint is already built diff --git a/Makefile b/Makefile index ff8163a308..a7613fbf42 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ else export GOPATH := $(shell go env GOPATH) GOPATH1 := $(firstword $(subst :, ,$(GOPATH))) endif -export GOPROXY := direct SRCPATH := $(shell pwd) ARCH := $(shell ./scripts/archtype.sh) OS_TYPE := $(shell ./scripts/ostype.sh) diff --git a/scripts/get_golang_version.sh b/scripts/get_golang_version.sh index 390847ed4d..4e3525a548 100755 --- a/scripts/get_golang_version.sh +++ b/scripts/get_golang_version.sh @@ -11,7 +11,7 @@ # Our build task-runner `mule` will refer to this script and will automatically # build a new image whenever the version number has been changed. -BUILD=1.17.9 +BUILD=1.17.13 MIN=1.17 GO_MOD_SUPPORT=1.17