From a4a6afad8375ddd218a853e1a804d0d629919744 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Fri, 25 Jun 2021 15:24:25 -0700 Subject: [PATCH 01/73] all: cache go module downloads and other build and test artifacts --- .github/workflows/go.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1564254d48..e3cf5dd169 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,6 +19,14 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh @@ -37,6 +45,14 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - run: go build ./... test: @@ -83,4 +99,12 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - run: go test -race -cover ./... From 0c4c8b16e2d8b87ce8b647db73603e6e71cbc77b Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Fri, 25 Jun 2021 22:35:10 +0000 Subject: [PATCH 02/73] empty commit From 39da1f17534a43e1e6a6a7290b7cb8835937113c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Wed, 30 Jun 2021 22:58:46 -0700 Subject: [PATCH 03/73] try test caching --- .github/workflows/go.yml | 45 +++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e3cf5dd169..836880625a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,12 +21,14 @@ jobs: go-version: ${{ matrix.go }} - uses: actions/cache@v2 with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + path: ~/go/pkg/mod + key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod + - uses: actions/cache@v2 + with: + path: ~/.cache/go-build + key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh @@ -47,12 +49,14 @@ jobs: go-version: ${{ matrix.go }} - uses: actions/cache@v2 with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + path: ~/go/pkg/mod + key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod + - uses: actions/cache@v2 + with: + path: ~/.cache/go-build + key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all - run: go build ./... test: @@ -61,6 +65,7 @@ jobs: os: [ubuntu-latest] go: [1.16.5, 1.15.13] pg: [9.6.5, 10] + testopts: ['', '-race -cover'] runs-on: ${{ matrix.os }} services: postgres: @@ -101,10 +106,12 @@ jobs: go-version: ${{ matrix.go }} - uses: actions/cache@v2 with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - run: go test -race -cover ./... + path: ~/go/pkg/mod + key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod + - uses: actions/cache@v2 + with: + path: ~/.cache/go-build + key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all + - run: go test ${{ matrix.testops }} ./... From df8e6a17e81bddb4a151d8122b94740d5a531227 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Wed, 30 Jun 2021 23:07:07 -0700 Subject: [PATCH 04/73] fix test opts --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 836880625a..e02c6923a2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -114,4 +114,4 @@ jobs: path: ~/.cache/go-build key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all - - run: go test ${{ matrix.testops }} ./... + - run: go test ${{ matrix.testopts }} ./... From 5ca6b09366c10c2a02f3b8339402c869334d7ce6 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Wed, 30 Jun 2021 23:12:24 -0700 Subject: [PATCH 05/73] include matrix in cache key --- .github/workflows/go.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e02c6923a2..b739999b58 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,13 +22,13 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh @@ -50,13 +50,13 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all - run: go build ./... test: @@ -107,11 +107,11 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all - run: go test ${{ matrix.testopts }} ./... From 2668a1bda3bcb28d31b11bd70a03ef92e244e752 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Wed, 30 Jun 2021 23:27:24 -0700 Subject: [PATCH 06/73] jsonify matrix in cache key --- .github/workflows/go.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b739999b58..5667ea353f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,13 +22,13 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh @@ -50,13 +50,13 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all - run: go build ./... test: @@ -107,11 +107,11 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all - run: go test ${{ matrix.testopts }} ./... From e4cbe6bf9bf6aaf8bfe5de40e69d852063793915 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Wed, 30 Jun 2021 23:35:16 -0700 Subject: [PATCH 07/73] fix matrix --- .github/workflows/go.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5667ea353f..724a4e6406 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,13 +22,13 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh @@ -50,13 +50,13 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all - run: go build ./... test: @@ -107,11 +107,11 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.testopts }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.testopts }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ toJSON(matrix) }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.testopts }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.testopts }}-${{ github.ref }}-${{ runner.os }}-go-all - run: go test ${{ matrix.testopts }} ./... From 81dfed00c967d0722bbf1aaafc37f7d93570ea24 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Thu, 1 Jul 2021 12:32:03 -0700 Subject: [PATCH 08/73] less tests --- .github/workflows/go.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 724a4e6406..2c95861560 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -65,7 +65,6 @@ jobs: os: [ubuntu-latest] go: [1.16.5, 1.15.13] pg: [9.6.5, 10] - testopts: ['', '-race -cover'] runs-on: ${{ matrix.os }} services: postgres: @@ -107,11 +106,11 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.testopts }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.testopts }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.testopts }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.testopts }}-${{ github.ref }}-${{ runner.os }}-go-all - - run: go test ${{ matrix.testopts }} ./... + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-all + - run: go test -race -cover ./... From 605d65e0988b7ed24d678fa354fa862217b895ed Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Thu, 1 Jul 2021 13:28:33 -0700 Subject: [PATCH 09/73] remove github ref from key of mod cache --- .github/workflows/go.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2c95861560..ca891ab474 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,8 +22,8 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build @@ -50,8 +50,8 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build @@ -106,8 +106,8 @@ jobs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 with: path: ~/.cache/go-build From 9c8c345f6424edb51b51a841ce7c73e45484d0e4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Thu, 1 Jul 2021 13:30:35 -0700 Subject: [PATCH 10/73] skip build/test caches on master --- .github/workflows/go.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ca891ab474..bca4756391 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,6 +25,7 @@ jobs: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 + if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} @@ -53,6 +54,7 @@ jobs: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 + if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} @@ -109,6 +111,7 @@ jobs: key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - uses: actions/cache@v2 + if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} From 0f9d7f7f6a370cd39e80d79d05b1692cbb39c116 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Wed, 14 Jul 2021 09:08:53 -0700 Subject: [PATCH 11/73] Cache across branches on initial runs --- .github/workflows/go.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bca4756391..b13121f7b6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,8 +28,10 @@ jobs: if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + restore-keys: | + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }} + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh @@ -57,8 +59,10 @@ jobs: if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + restore-keys: | + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }} + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all - run: go build ./... test: @@ -114,6 +118,8 @@ jobs: if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-all-${{ hashFiles('**', '!.git') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ github.ref }}-${{ runner.os }}-go-all + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + restore-keys: | + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ runner.os }}-go-all-${{ github.ref }} + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ runner.os }}-go-all - run: go test -race -cover ./... From 5db26e1a0c915fc5921b1bc28b84e687afd8cea4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 10:52:00 -0800 Subject: [PATCH 12/73] Add caching to integration test --- .github/workflows/horizon.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 8e52d11066..bb75feb3da 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -42,6 +42,19 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod + - uses: actions/cache@v2 + if: ${{ github.ref != 'master' }} + with: + path: ~/.cache/go-build + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.ingestion-backend }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + restore-keys: | + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.ingestion-backend }}-${{ runner.os }}-go-all-${{ github.ref }} + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.ingestion-backend }}-${{ runner.os }}-go-all - name: Pull latest Stellar Core image run: docker pull stellar/stellar-core - if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }} From 189950c43f89ea908699953d298b120f1a81b371 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 11:28:43 -0800 Subject: [PATCH 13/73] empty From ca3ec4e3e221cebf9dc840b6bc3f34b16409d1c0 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 23 Feb 2022 21:27:39 +0100 Subject: [PATCH 14/73] Try to factor out go caching --- .github/actions/cache-go/action.yml | 17 +++++++++++++++++ .github/workflows/go.yml | 14 +------------- 2 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 .github/actions/cache-go/action.yml diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml new file mode 100644 index 0000000000..c88a044246 --- /dev/null +++ b/.github/actions/cache-go/action.yml @@ -0,0 +1,17 @@ +name: 'Cache Go dependencies and test results' +runs: + using: "composite" + steps: + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod + - uses: actions/cache@v2 + if: ${{ github.ref != 'master' }} + with: + path: ~/.cache/go-build + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + restore-keys: | + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }} + ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8820bb6539..0174d984ce 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,19 +19,7 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - - uses: actions/cache@v2 - if: ${{ github.ref != 'master' }} - with: - path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} - restore-keys: | - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }} - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all + - uses: ./.github/actions/cache-go - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh From b6feaf65aa428a30be81099c0600dfc509289be0 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 23 Feb 2022 21:32:29 +0100 Subject: [PATCH 15/73] Factor out the rest of the actions --- .github/workflows/go.yml | 28 ++-------------------------- .github/workflows/horizon.yml | 14 +------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0174d984ce..4464649a46 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -38,19 +38,7 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - - uses: actions/cache@v2 - if: ${{ github.ref != 'master' }} - with: - path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} - restore-keys: | - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }} - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all + - uses: ./.github/actions/cache-go - run: go build ./... test: @@ -97,17 +85,5 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - - uses: actions/cache@v2 - if: ${{ github.ref != 'master' }} - with: - path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} - restore-keys: | - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ runner.os }}-go-all-${{ github.ref }} - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ runner.os }}-go-all + - uses: ./.github/actions/cache-go - run: go test -race -cover ./... diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index bb75feb3da..3270514649 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -42,19 +42,7 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod - - uses: actions/cache@v2 - if: ${{ github.ref != 'master' }} - with: - path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.ingestion-backend }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} - restore-keys: | - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.ingestion-backend }}-${{ runner.os }}-go-all-${{ github.ref }} - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ matrix.pg }}-${{ matrix.ingestion-backend }}-${{ runner.os }}-go-all + - uses: ./.github/actions/cache-go - name: Pull latest Stellar Core image run: docker pull stellar/stellar-core - if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }} From 3fc5d942998610da0b449e69660133581ed39f32 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:37:25 -0800 Subject: [PATCH 16/73] Include full matrix in cache keys --- .github/actions/cache-go/action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index c88a044246..abd26d46bf 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -5,13 +5,13 @@ runs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-mod - uses: actions/cache@v2 if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} restore-keys: | - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all-${{ github.ref }} - ${{ github.workflow }}-${{ github.job }}-${{ matrix.go }}-${{ runner.os }}-go-all + ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-build-${{ github.ref }} + ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-build From 21638afe67868a6f9d8ddf6a3ac4460e5455cb63 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:39:55 -0800 Subject: [PATCH 17/73] Make matrix json --- .github/actions/cache-go/action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index abd26d46bf..a0edde36d5 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -5,13 +5,13 @@ runs: - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-mod - uses: actions/cache@v2 if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} restore-keys: | - ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-build-${{ github.ref }} - ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ matrix }}-go-build + ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-build-${{ github.ref }} + ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-build From 5264d4099cbcf776c043ee5f4274d62437cfa711 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:47:45 -0800 Subject: [PATCH 18/73] Try serializing matrix manually --- .github/actions/cache-go/action.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index a0edde36d5..660bb2741d 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -2,16 +2,23 @@ name: 'Cache Go dependencies and test results' runs: using: "composite" steps: + - uses: actions/github-script@v6 + id: serialize-matrix + with: + script: return matrix.go + result-encoding: string + - name: Get result + run: echo "${{steps.serialize-matrix.outputs.result}}" - uses: actions/cache@v2 with: path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-mod + key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-mod - uses: actions/cache@v2 if: ${{ github.ref != 'master' }} with: path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} restore-keys: | - ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-build-${{ github.ref }} - ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ toJSON(matrix) }}-go-build + ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-build-${{ github.ref }} + ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-build From 7e8545f74ea5195189961f9459cfdd5cc245973c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:48:31 -0800 Subject: [PATCH 19/73] Fix --- .github/actions/cache-go/action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index 660bb2741d..5bf2e5bce7 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -7,8 +7,6 @@ runs: with: script: return matrix.go result-encoding: string - - name: Get result - run: echo "${{steps.serialize-matrix.outputs.result}}" - uses: actions/cache@v2 with: path: ~/go/pkg/mod From 35ec250865021f92f2f1d14c518716cd5bb7b287 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:51:06 -0800 Subject: [PATCH 20/73] test --- .github/actions/cache-go/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index 5bf2e5bce7..c0358a2f90 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -1,11 +1,15 @@ name: 'Cache Go dependencies and test results' +params: + matrix: + required: true + default: ${{ toJSON(matrix) }} runs: using: "composite" steps: - uses: actions/github-script@v6 id: serialize-matrix with: - script: return matrix.go + script: return "1${{inputs.matrix}}1" result-encoding: string - uses: actions/cache@v2 with: From c4dded0b8c7d363ae222dfc64abb01362ff5a6c9 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:51:53 -0800 Subject: [PATCH 21/73] test --- .github/actions/cache-go/action.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index c0358a2f90..22d6549b1e 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -1,15 +1,11 @@ name: 'Cache Go dependencies and test results' -params: - matrix: - required: true - default: ${{ toJSON(matrix) }} runs: using: "composite" steps: - uses: actions/github-script@v6 id: serialize-matrix with: - script: return "1${{inputs.matrix}}1" + script: return "${{toJSON(matrix)}}" result-encoding: string - uses: actions/cache@v2 with: From aead14de58239ce4e9e69a3a8575e506a094fc54 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:54:30 -0800 Subject: [PATCH 22/73] test --- .github/actions/cache-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index 22d6549b1e..620d380100 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -5,7 +5,7 @@ runs: - uses: actions/github-script@v6 id: serialize-matrix with: - script: return "${{toJSON(matrix)}}" + script: return "${{join(matrix,",")}}" result-encoding: string - uses: actions/cache@v2 with: From 3623a9a20d0b59c5191891133ba65461dc47defb Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:55:08 -0800 Subject: [PATCH 23/73] test --- .github/actions/cache-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index 620d380100..c41adc669d 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -5,7 +5,7 @@ runs: - uses: actions/github-script@v6 id: serialize-matrix with: - script: return "${{join(matrix,",")}}" + script: return "${{join(matrix,',')}}" result-encoding: string - uses: actions/cache@v2 with: From 4296ac3e826e36a7d20f249e4c870073c43c129e Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:56:10 -0800 Subject: [PATCH 24/73] filter --- .github/actions/cache-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index c41adc669d..52230aa06f 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -5,7 +5,7 @@ runs: - uses: actions/github-script@v6 id: serialize-matrix with: - script: return "${{join(matrix,',')}}" + script: return "${{join(matrix.*,',')}}" result-encoding: string - uses: actions/cache@v2 with: From 735115099d8dae23fc3f4dd7eb7e07c6e1c1c5f9 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 21:56:49 -0800 Subject: [PATCH 25/73] test --- .github/actions/cache-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index 52230aa06f..a354efbfbb 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -5,7 +5,7 @@ runs: - uses: actions/github-script@v6 id: serialize-matrix with: - script: return "${{join(matrix.*,',')}}" + script: return "${{join(matrix.*,'=')}}" result-encoding: string - uses: actions/cache@v2 with: From f9e0bd693bbafd87d4efc8deef10f204b0978ec3 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:06:01 -0800 Subject: [PATCH 26/73] prefix --- .github/actions/cache-go/action.yml | 34 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index a354efbfbb..afc9a16786 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -2,21 +2,19 @@ name: 'Cache Go dependencies and test results' runs: using: "composite" steps: - - uses: actions/github-script@v6 - id: serialize-matrix - with: - script: return "${{join(matrix.*,'=')}}" - result-encoding: string - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-mod-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-mod - - uses: actions/cache@v2 - if: ${{ github.ref != 'master' }} - with: - path: ~/.cache/go-build - key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} - restore-keys: | - ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-build-${{ github.ref }} - ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ steps.serialize-matrix.outputs.result }}-go-build + + - shell: bash + run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'-') }})" >> $GITHUB_ENV + - uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ env.PREFIX }}-go-mod-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ env.PREFIX }}-go-mod + - uses: actions/cache@v2 + if: ${{ github.ref != 'master' }} + with: + path: ~/.cache/go-build + key: ${{ env.PREFIX }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} + restore-keys: | + ${{ env.PREFIX }}-go-build-${{ github.ref }} + ${{ env.PREFIX }}-go-build From c927412156fbb4c013cbfe312237de558c25ba25 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:07:12 -0800 Subject: [PATCH 27/73] fix --- .github/actions/cache-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index afc9a16786..1e06f71849 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -4,7 +4,7 @@ runs: steps: - shell: bash - run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'-') }})" >> $GITHUB_ENV + run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'-') }})' >> $GITHUB_ENV - uses: actions/cache@v2 with: path: ~/go/pkg/mod From 7f4fff2481e9937bd5261c7989b9484bd1fa0900 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:07:54 -0800 Subject: [PATCH 28/73] sep --- .github/actions/cache-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index 1e06f71849..ceceffa2a2 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -4,7 +4,7 @@ runs: steps: - shell: bash - run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'-') }})' >> $GITHUB_ENV + run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV - uses: actions/cache@v2 with: path: ~/go/pkg/mod From 63a338b7c109ee7dd0f5c19d000b797e4f149f94 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:09:10 -0800 Subject: [PATCH 29/73] line --- .github/actions/cache-go/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index ceceffa2a2..438df659a4 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -2,7 +2,6 @@ name: 'Cache Go dependencies and test results' runs: using: "composite" steps: - - shell: bash run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV - uses: actions/cache@v2 From 1f5e7bb4da4ca730e9214196f7dddaf7e22ef32f Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:10:16 -0800 Subject: [PATCH 30/73] comment --- .github/actions/cache-go/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index 438df659a4..dd798a0eb0 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -3,6 +3,7 @@ runs: using: "composite" steps: - shell: bash + # The PREFIX must uniquely identify the specific instance of a job executing. run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV - uses: actions/cache@v2 with: From 1081bd08a98a79c1151786db4d3d8f2f53c4d3d7 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:12:00 -0800 Subject: [PATCH 31/73] safer --- .github/actions/cache-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index dd798a0eb0..b888a812b7 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -11,7 +11,7 @@ runs: key: ${{ env.PREFIX }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: ${{ env.PREFIX }}-go-mod - uses: actions/cache@v2 - if: ${{ github.ref != 'master' }} + if: ${{ github.ref_protected || github.ref != 'master' || github.ref != 'main' }} with: path: ~/.cache/go-build key: ${{ env.PREFIX }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} From 76c6f090afdba51b58051ea3f396de54ef5b0f7a Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:13:48 -0800 Subject: [PATCH 32/73] comments --- .github/actions/cache-go/action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index b888a812b7..9c39872dba 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -2,14 +2,21 @@ name: 'Cache Go dependencies and test results' runs: using: "composite" steps: + + # The PREFIX must uniquely identify the specific instance of a job executing. - shell: bash - # The PREFIX must uniquely identify the specific instance of a job executing. run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV + + # Cache the Go Modules downloaded during the job. - uses: actions/cache@v2 with: path: ~/go/pkg/mod key: ${{ env.PREFIX }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: ${{ env.PREFIX }}-go-mod + + # Cache any build and test artifacts during the job, which will speed up + # rebuilds and cause test runs to skip tests that have no reason to rerun. + # Don't run this for protected branches like master/main. - uses: actions/cache@v2 if: ${{ github.ref_protected || github.ref != 'master' || github.ref != 'main' }} with: From 4797ad317708332c812fb34ec9614b77a0d789f4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 23 Feb 2022 22:14:48 -0800 Subject: [PATCH 33/73] comment --- .github/workflows/horizon.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 3270514649..650ed54891 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -43,6 +43,8 @@ jobs: with: go-version: ${{ matrix.go }} - uses: ./.github/actions/cache-go + # Note that cache-go does very little for integration tests as the + # integration tests are not cacheable and `go test` reruns all the tests. - name: Pull latest Stellar Core image run: docker pull stellar/stellar-core - if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }} From 8606b7876c999a6a8d29038da9101cafdd2ee606 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 08:37:59 +0100 Subject: [PATCH 34/73] Move captive core version to the matrix --- .github/workflows/horizon.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 650ed54891..c123ccaf9b 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -14,6 +14,7 @@ jobs: go: [1.17] pg: [9.6.5] ingestion-backend: [db, captive-core, captive-core-remote-storage] + captive-core: [18.0.3-746.f3baea6.focal] runs-on: ${{ matrix.os }} services: postgres: @@ -49,12 +50,10 @@ jobs: run: docker pull stellar/stellar-core - if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }} name: Install and enable Captive Core - env: - CAPTIVE_CORE_VERSION: 18.0.3-746.f3baea6.focal run: | sudo wget -qO - https://apt.stellar.org/SDF.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=true sudo apt-key add - sudo bash -c 'echo "deb https://apt.stellar.org focal unstable" > /etc/apt/sources.list.d/SDF-unstable.list' - sudo apt-get update && sudo apt-get install -y stellar-core=$CAPTIVE_CORE_VERSION + sudo apt-get update && sudo apt-get install -y stellar-core=${{ matrix.captive-core }} echo "Using stellar core version $(stellar-core version)" echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE=true' >> $GITHUB_ENV echo 'CAPTIVE_CORE_BIN=/usr/bin/stellar-core' >> $GITHUB_ENV From f3f67b6a2043dfe01b17c804e3646cd6b3a1d2fd Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 09:09:58 +0100 Subject: [PATCH 35/73] Add integration test caching debug logging --- .github/workflows/horizon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index c123ccaf9b..a56509b5fe 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -60,5 +60,5 @@ jobs: - if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }} name: Setup Captive Core Remote Storage run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV - - run: go test -race -timeout 25m -v ./services/horizon/internal/integration/... + - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v ./services/horizon/internal/integration/... From 444717ae4c81a6075ceedaa8d95c666c0ad0af67 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 10:39:15 +0100 Subject: [PATCH 36/73] Also print test caching output for integration tests --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4464649a46..b560839012 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -86,4 +86,4 @@ jobs: with: go-version: ${{ matrix.go }} - uses: ./.github/actions/cache-go - - run: go test -race -cover ./... + - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -cover ./... From 62fe98c5ccdc63fc4b968f7f34dcb677fc874acf Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 11:37:56 +0100 Subject: [PATCH 37/73] Restore modification times to see if that helps --- .github/workflows/horizon.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index a56509b5fe..417992a124 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -39,6 +39,10 @@ jobs: PGDATABASE: postgres steps: - uses: actions/checkout@v2 + - name: restore modification time of checkout files + run: | + sudo apt-get update && sudo apt-get install -y git-restore-mtime + git restore-mtime - name: Set up Go uses: actions/setup-go@v2 with: From 38c7632884a1f098ef13bebed02999cf52d97f66 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 12:00:53 +0100 Subject: [PATCH 38/73] Also restore the modification time when running normal tests --- .github/workflows/go.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b560839012..e196802998 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -81,6 +81,10 @@ jobs: REDIS_PORT: 6379 steps: - uses: actions/checkout@v2 + - name: restore modification time of checkout files + run: | + sudo apt-get update && sudo apt-get install -y git-restore-mtime + git restore-mtime - name: Set up Go uses: actions/setup-go@v2 with: From 5dab08158282255f897026abcf84a546007c8935 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 12:09:24 +0100 Subject: [PATCH 39/73] Clarify why restoring the modification time is needed --- .github/workflows/horizon.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 417992a124..24a4a2c4ee 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -39,9 +39,11 @@ jobs: PGDATABASE: postgres steps: - uses: actions/checkout@v2 - - name: restore modification time of checkout files + - name: Restore modification time of checkout files + # Otherwise, Go test caching doesn't work for tests opening input files (e.g. fixtures) in the + # in the repository. run: | - sudo apt-get update && sudo apt-get install -y git-restore-mtime + sudo apt-get install -y git-restore-mtime git restore-mtime - name: Set up Go uses: actions/setup-go@v2 From 10367b4fda286b7617265276aece954aa23631ea Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 12:15:27 +0100 Subject: [PATCH 40/73] Remove cache debug noise from normal tests --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e196802998..aed48d4a11 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -90,4 +90,4 @@ jobs: with: go-version: ${{ matrix.go }} - uses: ./.github/actions/cache-go - - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -cover ./... + - run: go test -race -cover ./... From 2abb7ff6d386cc78b4755d4ce53679e54a55cd5c Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 12:36:36 +0100 Subject: [PATCH 41/73] Debug why the ingest test isn't cache --- .github/workflows/go.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index aed48d4a11..93fc03f47f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -90,4 +90,5 @@ jobs: with: go-version: ${{ matrix.go }} - uses: ./.github/actions/cache-go + - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -cover ./services/horizon/internal/ingest - run: go test -race -cover ./... From 8bd0c36e5c54a87d88620a3d5797467025df3cbb Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 13:53:43 +0100 Subject: [PATCH 42/73] Remove debugging info in normal tests --- .github/workflows/go.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 93fc03f47f..aed48d4a11 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -90,5 +90,4 @@ jobs: with: go-version: ${{ matrix.go }} - uses: ./.github/actions/cache-go - - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -cover ./services/horizon/internal/ingest - run: go test -race -cover ./... From e795c91b4369d311da314d991583b64f872c0103 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 13:57:16 +0100 Subject: [PATCH 43/73] Add comment --- .github/workflows/go.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index aed48d4a11..10e17ca427 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -82,6 +82,8 @@ jobs: steps: - uses: actions/checkout@v2 - name: restore modification time of checkout files + # Otherwise, Go test caching doesn't work for tests opening input files (e.g. fixtures) in the + # in the repository. run: | sudo apt-get update && sudo apt-get install -y git-restore-mtime git restore-mtime From ca33d9cb15b73de65120f6a28f888fd9edff7af4 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 14:06:13 +0100 Subject: [PATCH 44/73] Refine comments --- .github/workflows/go.yml | 4 +++- .github/workflows/horizon.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 10e17ca427..8c54668444 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -82,7 +82,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: restore modification time of checkout files - # Otherwise, Go test caching doesn't work for tests opening input files (e.g. fixtures) in the + # `git clone` sets the modification time of tiles in the working directory to the current time. + # Restore original modification time of files based on the date of the most recent commit that modified them. + # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) # in the repository. run: | sudo apt-get update && sudo apt-get install -y git-restore-mtime diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 24a4a2c4ee..506944851e 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -40,7 +40,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Restore modification time of checkout files - # Otherwise, Go test caching doesn't work for tests opening input files (e.g. fixtures) in the + # `git clone` sets the modification time of tiles in the working directory to the current time. + # Restore original modification time of files based on the date of the most recent commit that modified them. + # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) # in the repository. run: | sudo apt-get install -y git-restore-mtime From db049474d86b30bb88c38c4801b0fbb5aa31cb62 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 14:37:21 +0100 Subject: [PATCH 45/73] Check whether restore-mtime is doing its job --- .github/workflows/go.yml | 4 +++- .github/workflows/horizon.yml | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8c54668444..c2c38edfe8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -87,8 +87,10 @@ jobs: # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) # in the repository. run: | + stat -c '%n: %y' . services/horizon/internal/integration services/horizon/internal/integration .dockerignore sudo apt-get update && sudo apt-get install -y git-restore-mtime - git restore-mtime + git restore-mtime -c -v + stat -c '%n: %y' . services/horizon/internal/integration services/horizon/internal/integration .dockerignore - name: Set up Go uses: actions/setup-go@v2 with: diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 506944851e..79966ac43a 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -45,8 +45,10 @@ jobs: # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) # in the repository. run: | - sudo apt-get install -y git-restore-mtime - git restore-mtime + stat -c '%n: %y' . services/horizon/internal/integration services/horizon/internal/integration .dockerignore + sudo apt-get update && sudo apt-get install -y git-restore-mtime + git restore-mtime -v -c + stat -c '%n: %y' . services/horizon/internal/integration services/horizon/internal/integration .dockerignore - name: Set up Go uses: actions/setup-go@v2 with: From 56761cc3bfae3544b96cfeea1b559bb152b492cc Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 14:51:57 +0100 Subject: [PATCH 46/73] Debug modification times futher --- .github/workflows/horizon.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 79966ac43a..640039677a 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -45,10 +45,14 @@ jobs: # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) # in the repository. run: | - stat -c '%n: %y' . services/horizon/internal/integration services/horizon/internal/integration .dockerignore + stat -c '%n: %y' . services/horizon/internal/integration .dockerignore sudo apt-get update && sudo apt-get install -y git-restore-mtime git restore-mtime -v -c - stat -c '%n: %y' . services/horizon/internal/integration services/horizon/internal/integration .dockerignore + stat -c '%n: %y' . services/horizon/internal/integration .dockerignore + touch .dockerignore + stat -c '%n: %y' .dockerignore + touch -d "2 hours ago" .dockerignore + stat -c '%n: %y' .dockerignore - name: Set up Go uses: actions/setup-go@v2 with: From 7b8c4a1aab3de89413f317b53a819b11cdda2b5c Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 15:12:46 +0100 Subject: [PATCH 47/73] It seems git-restore-mtime didn't work, use a simpler approach --- .github/workflows/go.yml | 8 ++------ .github/workflows/horizon.yml | 12 ++---------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c2c38edfe8..636cdb5004 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -81,16 +81,12 @@ jobs: REDIS_PORT: 6379 steps: - uses: actions/checkout@v2 - - name: restore modification time of checkout files + - name: Fix modification time of working directory # `git clone` sets the modification time of tiles in the working directory to the current time. # Restore original modification time of files based on the date of the most recent commit that modified them. # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) # in the repository. - run: | - stat -c '%n: %y' . services/horizon/internal/integration services/horizon/internal/integration .dockerignore - sudo apt-get update && sudo apt-get install -y git-restore-mtime - git restore-mtime -c -v - stat -c '%n: %y' . services/horizon/internal/integration services/horizon/internal/integration .dockerignore + run: touch -m -t '202001010101' $(find . -not -path '.git/*') - name: Set up Go uses: actions/setup-go@v2 with: diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 640039677a..4caa7c634c 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -39,20 +39,12 @@ jobs: PGDATABASE: postgres steps: - uses: actions/checkout@v2 - - name: Restore modification time of checkout files + - name: Fix modification time of working directory # `git clone` sets the modification time of tiles in the working directory to the current time. # Restore original modification time of files based on the date of the most recent commit that modified them. # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) # in the repository. - run: | - stat -c '%n: %y' . services/horizon/internal/integration .dockerignore - sudo apt-get update && sudo apt-get install -y git-restore-mtime - git restore-mtime -v -c - stat -c '%n: %y' . services/horizon/internal/integration .dockerignore - touch .dockerignore - stat -c '%n: %y' .dockerignore - touch -d "2 hours ago" .dockerignore - stat -c '%n: %y' .dockerignore + run: touch -m -t '202001010101' $(find . -not -path '.git/*') - name: Set up Go uses: actions/setup-go@v2 with: From 962c08b1157a0b76ad90009cb70a9665387f7bdb Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 16:32:33 +0100 Subject: [PATCH 48/73] Clarify comment --- .github/workflows/go.yml | 4 ++-- .github/workflows/horizon.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 636cdb5004..398d5a0669 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -82,10 +82,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Fix modification time of working directory - # `git clone` sets the modification time of tiles in the working directory to the current time. + # `git clone` sets the modification time of files in the working directory to the current time. # Restore original modification time of files based on the date of the most recent commit that modified them. # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) - # in the repository. + # in the repository, since it uses the modification time of open files as part of the cache hash key. run: touch -m -t '202001010101' $(find . -not -path '.git/*') - name: Set up Go uses: actions/setup-go@v2 diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 4caa7c634c..081e67ae0f 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -40,10 +40,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Fix modification time of working directory - # `git clone` sets the modification time of tiles in the working directory to the current time. + # `git clone` sets the modification time of files in the working directory to the current time. # Restore original modification time of files based on the date of the most recent commit that modified them. # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) - # in the repository. + # in the repository, since it uses the modification time of open files as part of the cache hash key. run: touch -m -t '202001010101' $(find . -not -path '.git/*') - name: Set up Go uses: actions/setup-go@v2 From 3c536a1d63f1a7229d09d95e4a975bb3a65f3a60 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 17:13:47 +0100 Subject: [PATCH 49/73] Try to figure out where we create the captive-core directory --- ingest/ledgerbackend/stellar_core_runner.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ingest/ledgerbackend/stellar_core_runner.go b/ingest/ledgerbackend/stellar_core_runner.go index 876caf1355..da1f0aec96 100644 --- a/ingest/ledgerbackend/stellar_core_runner.go +++ b/ingest/ledgerbackend/stellar_core_runner.go @@ -13,6 +13,7 @@ import ( "path/filepath" "regexp" "runtime" + "runtime/debug" "strings" "sync" "time" @@ -93,6 +94,8 @@ func newStellarCoreRunner(config CaptiveCoreConfig, mode stellarCoreRunnerMode) // We also want to use random directories in offline mode (reingestion) // because it's possible it's running multiple Stellar-Cores on a single // machine. + fmt.Println("FONS: We are creating a captive-core directory") + debug.PrintStack() fullStoragePath = path.Join(config.StoragePath, "captive-core-"+createRandomHexString(8)) } else { // Use the specified directory to store Captive Core's data: From e46f5aae879b39b304b3b141f0bacd4db941a1c8 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 17:58:20 +0100 Subject: [PATCH 50/73] Run a single integration test to debug things faster --- .github/workflows/horizon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 081e67ae0f..e31247e1d2 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -66,5 +66,5 @@ jobs: - if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }} name: Setup Captive Core Remote Storage run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV - - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v ./services/horizon/internal/integration/... + - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v -run ^\QTestHappyClawbackClaimableBalance\E$ ./services/horizon/internal/integration/... From 3d2dd7238e58833540a56b0942a1104df1da43d4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 24 Feb 2022 09:23:48 -0800 Subject: [PATCH 51/73] Move mtime to cache-go --- .github/actions/cache-go/action.yml | 7 +++++++ .github/workflows/go.yml | 6 ------ .github/workflows/horizon.yml | 6 ------ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index 9c39872dba..afe30ffd7c 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -3,6 +3,13 @@ runs: using: "composite" steps: + # Set the modification time of all files to a fixed time. `git clone` sets the + # modification time to the current time, but Go tests that access fixtures get + # invalidated if their modification times change. Setting a fixed time + # improves cache hits. + - shell: bash + run: touch -m -t '202201010101' $(find . -not -path '.git/*') + # The PREFIX must uniquely identify the specific instance of a job executing. - shell: bash run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 398d5a0669..4464649a46 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -81,12 +81,6 @@ jobs: REDIS_PORT: 6379 steps: - uses: actions/checkout@v2 - - name: Fix modification time of working directory - # `git clone` sets the modification time of files in the working directory to the current time. - # Restore original modification time of files based on the date of the most recent commit that modified them. - # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) - # in the repository, since it uses the modification time of open files as part of the cache hash key. - run: touch -m -t '202001010101' $(find . -not -path '.git/*') - name: Set up Go uses: actions/setup-go@v2 with: diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index e31247e1d2..d9a589df4c 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -39,12 +39,6 @@ jobs: PGDATABASE: postgres steps: - uses: actions/checkout@v2 - - name: Fix modification time of working directory - # `git clone` sets the modification time of files in the working directory to the current time. - # Restore original modification time of files based on the date of the most recent commit that modified them. - # Otherwise, Golang test caching doesn't work for tests opening input files (e.g. fixtures) - # in the repository, since it uses the modification time of open files as part of the cache hash key. - run: touch -m -t '202001010101' $(find . -not -path '.git/*') - name: Set up Go uses: actions/setup-go@v2 with: From de37391db03de70ca32ea6d279c0d079cdf2fa17 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 18:50:24 +0100 Subject: [PATCH 52/73] Use /tmp for the captive-core storage path in integration tests --- .github/workflows/horizon.yml | 2 +- ingest/ledgerbackend/stellar_core_runner.go | 3 --- services/horizon/internal/test/integration/integration.go | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index d9a589df4c..a56509b5fe 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -60,5 +60,5 @@ jobs: - if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }} name: Setup Captive Core Remote Storage run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV - - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v -run ^\QTestHappyClawbackClaimableBalance\E$ ./services/horizon/internal/integration/... + - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v ./services/horizon/internal/integration/... diff --git a/ingest/ledgerbackend/stellar_core_runner.go b/ingest/ledgerbackend/stellar_core_runner.go index da1f0aec96..876caf1355 100644 --- a/ingest/ledgerbackend/stellar_core_runner.go +++ b/ingest/ledgerbackend/stellar_core_runner.go @@ -13,7 +13,6 @@ import ( "path/filepath" "regexp" "runtime" - "runtime/debug" "strings" "sync" "time" @@ -94,8 +93,6 @@ func newStellarCoreRunner(config CaptiveCoreConfig, mode stellarCoreRunnerMode) // We also want to use random directories in offline mode (reingestion) // because it's possible it's running multiple Stellar-Cores on a single // machine. - fmt.Println("FONS: We are creating a captive-core directory") - debug.PrintStack() fullStoragePath = path.Join(config.StoragePath, "captive-core-"+createRandomHexString(8)) } else { // Use the specified directory to store Captive Core's data: diff --git a/services/horizon/internal/test/integration/integration.go b/services/horizon/internal/test/integration/integration.go index 622ec22f65..50dd03e9e9 100644 --- a/services/horizon/internal/test/integration/integration.go +++ b/services/horizon/internal/test/integration/integration.go @@ -313,6 +313,7 @@ func (i *Test) StartHorizon() error { "captive-core-config-path": captiveCoreConfigPath, "captive-core-http-port": "21626", "captive-core-use-db": captiveCoreUseDB, + "captive-core-storage-path": os.TempDir(), "enable-captive-core-ingestion": strconv.FormatBool(len(coreBinaryPath) > 0), "ingest": "true", "history-archive-urls": fmt.Sprintf("http://%s:%d", hostname, historyArchivePort), From 2d16f5fb7093ca03f59068a1d76ba7ff6ade4c7d Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 24 Feb 2022 12:04:13 -0800 Subject: [PATCH 53/73] Remove debug --- .github/workflows/horizon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index a56509b5fe..c123ccaf9b 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -60,5 +60,5 @@ jobs: - if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }} name: Setup Captive Core Remote Storage run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV - - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v ./services/horizon/internal/integration/... + - run: go test -race -timeout 25m -v ./services/horizon/internal/integration/... From 18e25de48ffbb7470b2516315c498f64af87e082 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 24 Feb 2022 13:07:20 -0800 Subject: [PATCH 54/73] empty From 8cb5d98dcc8cc5bd0f139c1fccae3245c3b2db39 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 24 Feb 2022 18:57:06 +0100 Subject: [PATCH 55/73] Add comment about why we set the storage path outside of the package --- .../horizon/internal/test/integration/integration.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/services/horizon/internal/test/integration/integration.go b/services/horizon/internal/test/integration/integration.go index 50dd03e9e9..8a3cb81bce 100644 --- a/services/horizon/internal/test/integration/integration.go +++ b/services/horizon/internal/test/integration/integration.go @@ -309,10 +309,12 @@ func (i *Test) StartHorizon() error { hostname, stellarCorePostgresPort, ), - "stellar-core-binary-path": coreBinaryPath, - "captive-core-config-path": captiveCoreConfigPath, - "captive-core-http-port": "21626", - "captive-core-use-db": captiveCoreUseDB, + "stellar-core-binary-path": coreBinaryPath, + "captive-core-config-path": captiveCoreConfigPath, + "captive-core-http-port": "21626", + "captive-core-use-db": captiveCoreUseDB, + // Create the storage directory outside of the source repo + // otherwise it will break Golang test caching. "captive-core-storage-path": os.TempDir(), "enable-captive-core-ingestion": strconv.FormatBool(len(coreBinaryPath) > 0), "ingest": "true", From d2cc3d4d44bdf6d7f72fb5438b90990a32392d36 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 13:58:44 +0100 Subject: [PATCH 56/73] Yet another storage path out of the repo --- services/horizon/internal/integration/db_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/horizon/internal/integration/db_test.go b/services/horizon/internal/integration/db_test.go index 26c9b9b595..0892fcbb56 100644 --- a/services/horizon/internal/integration/db_test.go +++ b/services/horizon/internal/integration/db_test.go @@ -3,6 +3,7 @@ package integration import ( "context" "fmt" + "os" "path/filepath" "strconv" "testing" @@ -538,6 +539,9 @@ func command(horizonConfig horizon.Config, args ...string) []string { // due to ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING "--checkpoint-frequency", "8", + // Create the storage directory outside of the source repo + // otherwise it will break Golang test caching. + "--captive-core-storage-path=" + os.TempDir(), }, args...) } From 1805e12021e6c1e969e03262ef46623e103abfcb Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 14:29:24 +0100 Subject: [PATCH 57/73] Reenable debug info --- .github/workflows/horizon.yml | 2 +- services/horizon/internal/integration/db_test.go | 2 +- services/horizon/internal/test/integration/integration.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index c123ccaf9b..a56509b5fe 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -60,5 +60,5 @@ jobs: - if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }} name: Setup Captive Core Remote Storage run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV - - run: go test -race -timeout 25m -v ./services/horizon/internal/integration/... + - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v ./services/horizon/internal/integration/... diff --git a/services/horizon/internal/integration/db_test.go b/services/horizon/internal/integration/db_test.go index 0892fcbb56..376af8e607 100644 --- a/services/horizon/internal/integration/db_test.go +++ b/services/horizon/internal/integration/db_test.go @@ -539,7 +539,7 @@ func command(horizonConfig horizon.Config, args ...string) []string { // due to ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING "--checkpoint-frequency", "8", - // Create the storage directory outside of the source repo + // Create the storage directory outside of the source repo, // otherwise it will break Golang test caching. "--captive-core-storage-path=" + os.TempDir(), }, args...) diff --git a/services/horizon/internal/test/integration/integration.go b/services/horizon/internal/test/integration/integration.go index 8a3cb81bce..bd7de611a9 100644 --- a/services/horizon/internal/test/integration/integration.go +++ b/services/horizon/internal/test/integration/integration.go @@ -313,7 +313,7 @@ func (i *Test) StartHorizon() error { "captive-core-config-path": captiveCoreConfigPath, "captive-core-http-port": "21626", "captive-core-use-db": captiveCoreUseDB, - // Create the storage directory outside of the source repo + // Create the storage directory outside of the source repo, // otherwise it will break Golang test caching. "captive-core-storage-path": os.TempDir(), "enable-captive-core-ingestion": strconv.FormatBool(len(coreBinaryPath) > 0), From 7c6960c40067fcf0337f8b0bc263eec6513aa303 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 14:47:46 +0100 Subject: [PATCH 58/73] Use git-restore-mtime again --- .github/actions/cache-go/action.yml | 16 +++++++++------- .github/workflows/go.yml | 3 +++ .github/workflows/horizon.yml | 3 +++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/cache-go/action.yml index afe30ffd7c..b070f57e69 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/cache-go/action.yml @@ -1,15 +1,17 @@ name: 'Cache Go dependencies and test results' +description: 'Saves and restores the go modules and build cache, in order to speed up builds and tests' runs: using: "composite" steps: - # Set the modification time of all files to a fixed time. `git clone` sets the - # modification time to the current time, but Go tests that access fixtures get - # invalidated if their modification times change. Setting a fixed time - # improves cache hits. - - shell: bash - run: touch -m -t '202201010101' $(find . -not -path '.git/*') - + # Restore original modification time of files based on the date of the most recent commit that modified them. + # `git clone` sets the modification time to the current time, but Go tests that access fixtures get + # invalidated if their modification times change. + - name: Restore modification time of checkout files + shell: bash + run: | + sudo apt-get install -y git-restore-mtime + git restore-mtime -v # The PREFIX must uniquely identify the specific instance of a job executing. - shell: bash run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index eb902b8c4d..d28061854d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -83,6 +83,9 @@ jobs: REDIS_PORT: 6379 steps: - uses: actions/checkout@v2 + with: + # we need to full history for git-restore-mtime to know what modification dates to use + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v2 with: diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index a56509b5fe..97255e5b2c 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -39,6 +39,9 @@ jobs: PGDATABASE: postgres steps: - uses: actions/checkout@v2 + with: + # we need to full history for git-restore-mtime to know what modification dates to use + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v2 with: From 1970534c692b4cc833757b7ed5262de0930b79cb Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 14:55:11 +0100 Subject: [PATCH 59/73] See if the depth is accepted now --- .github/workflows/go.yml | 3 ++- .github/workflows/horizon.yml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d28061854d..670f3fba78 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -85,7 +85,8 @@ jobs: - uses: actions/checkout@v2 with: # we need to full history for git-restore-mtime to know what modification dates to use - fetch-depth: 0 + # Otherwise the Go test cache will fail (due to the modification time of fixtures changing). + fetch-depth: '0' - name: Set up Go uses: actions/setup-go@v2 with: diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 97255e5b2c..1a07f14ded 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -40,8 +40,9 @@ jobs: steps: - uses: actions/checkout@v2 with: - # we need to full history for git-restore-mtime to know what modification dates to use - fetch-depth: 0 + # We need to full history for git-restore-mtime to know what modification dates to use. + # Otherwise the Go test cache will fail (due to the modification time of fixtures changing). + fetch-depth: '0' - name: Set up Go uses: actions/setup-go@v2 with: From 940de194ccb3fefe0ba95589f7a8eab634e12969 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 15:06:43 +0100 Subject: [PATCH 60/73] Factor out the full Go setup --- .../actions/{cache-go => setup-go}/action.yml | 10 +++++--- .github/workflows/go.yml | 25 ++++--------------- .github/workflows/horizon.yml | 10 ++------ 3 files changed, 14 insertions(+), 31 deletions(-) rename .github/actions/{cache-go => setup-go}/action.yml (85%) diff --git a/.github/actions/cache-go/action.yml b/.github/actions/setup-go/action.yml similarity index 85% rename from .github/actions/cache-go/action.yml rename to .github/actions/setup-go/action.yml index b070f57e69..72ac81990e 100644 --- a/.github/actions/cache-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -1,9 +1,13 @@ -name: 'Cache Go dependencies and test results' -description: 'Saves and restores the go modules and build cache, in order to speed up builds and tests' +name: 'Setup the Go environment' +description: 'Installs go and restores/saves the build/module cache' runs: using: "composite" steps: - + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + stable: ${{ !contains(matrix.go, 'rc') }} # Restore original modification time of files based on the date of the most recent commit that modified them. # `git clone` sets the modification time to the current time, but Go tests that access fixtures get # invalidated if their modification times change. diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 670f3fba78..bd0f68b2d6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,12 +15,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - stable: ${{ !contains(matrix.go, 'rc') }} - - uses: ./.github/actions/cache-go + - uses: ./.github/actions/setup-go - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh @@ -35,12 +30,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - stable: ${{ !contains(matrix.go, 'rc') }} - - uses: ./.github/actions/cache-go + - uses: ./.github/actions/setup-go - run: go build ./... test: @@ -84,13 +74,8 @@ jobs: steps: - uses: actions/checkout@v2 with: - # we need to full history for git-restore-mtime to know what modification dates to use - # Otherwise the Go test cache will fail (due to the modification time of fixtures changing). + # We need to full history for git-restore-mtime to know what modification dates to use. + # Otherwise, the Go test cache will fail (due to the modification time of fixtures changing). fetch-depth: '0' - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - stable: ${{ !contains(matrix.go, 'rc') }} - - uses: ./.github/actions/cache-go + - uses: ./.github/actions/setup-go - run: go test -race -cover ./... diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 1a07f14ded..e0396f76ff 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -41,15 +41,9 @@ jobs: - uses: actions/checkout@v2 with: # We need to full history for git-restore-mtime to know what modification dates to use. - # Otherwise the Go test cache will fail (due to the modification time of fixtures changing). + # Otherwise, the Go test cache will fail (due to the modification time of fixtures changing). fetch-depth: '0' - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - - uses: ./.github/actions/cache-go - # Note that cache-go does very little for integration tests as the - # integration tests are not cacheable and `go test` reruns all the tests. + - uses: ./.github/actions/setup-go - name: Pull latest Stellar Core image run: docker pull stellar/stellar-core - if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }} From 1786d0aec5ab20c51e4ba92a9980c49e8df9ca6a Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 15:18:28 +0100 Subject: [PATCH 61/73] Remove debug --- .github/workflows/horizon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index e0396f76ff..9e7057adb5 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -58,5 +58,5 @@ jobs: - if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }} name: Setup Captive Core Remote Storage run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV - - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v ./services/horizon/internal/integration/... + - run: go test -race -timeout 25m -v ./services/horizon/internal/integration/... From 8ac9906cd88c26e6c6d7434ae8dc88a1c47ea342 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 15:22:00 +0100 Subject: [PATCH 62/73] Minor layout fix --- .github/actions/setup-go/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 72ac81990e..93d8cfceec 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -8,6 +8,7 @@ runs: with: go-version: ${{ matrix.go }} stable: ${{ !contains(matrix.go, 'rc') }} + # Restore original modification time of files based on the date of the most recent commit that modified them. # `git clone` sets the modification time to the current time, but Go tests that access fixtures get # invalidated if their modification times change. @@ -16,6 +17,7 @@ runs: run: | sudo apt-get install -y git-restore-mtime git restore-mtime -v + # The PREFIX must uniquely identify the specific instance of a job executing. - shell: bash run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV From 57d6f090074ed342f456fc1a1209adccd267922e Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 17:19:20 +0100 Subject: [PATCH 63/73] Cache is not working, again, re-enabling debug --- .github/workflows/horizon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 9e7057adb5..e0396f76ff 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -58,5 +58,5 @@ jobs: - if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }} name: Setup Captive Core Remote Storage run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV - - run: go test -race -timeout 25m -v ./services/horizon/internal/integration/... + - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v ./services/horizon/internal/integration/... From 0a90371a970d0bfbb59ec4fd10174cb3796f2efc Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 18:18:18 +0100 Subject: [PATCH 64/73] Set base modification time of directories --- .github/actions/setup-go/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 93d8cfceec..cd63c541ad 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -15,6 +15,9 @@ runs: - name: Restore modification time of checkout files shell: bash run: | + # git-restore-mtime doesn't correct restore the mtime of some directories. + # to make up for it we set a base, fixed modification time of all files + touch -m -t '202201010101' $(find . -type d -not -path '.git/*') sudo apt-get install -y git-restore-mtime git restore-mtime -v From d396b4cbc5ef3a73ef95941d6653bc8e0bcf122e Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 25 Feb 2022 09:50:38 -0800 Subject: [PATCH 65/73] parameterize go versiongp --- .github/actions/setup-go/action.yml | 7 +++++-- .github/workflows/go.yml | 6 ++++++ .github/workflows/horizon.yml | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index cd63c541ad..e337ef58bc 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -1,13 +1,16 @@ name: 'Setup the Go environment' description: 'Installs go and restores/saves the build/module cache' +inputs: + go-version: + required: true runs: using: "composite" steps: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: ${{ matrix.go }} - stable: ${{ !contains(matrix.go, 'rc') }} + go-version: ${{ inputs.go-version }} + stable: ${{ !(contains(inputs.go-version, 'beta') || contains(inputs.go-version, 'rc')) }} # Restore original modification time of files based on the date of the most recent commit that modified them. # `git clone` sets the modification time to the current time, but Go tests that access fixtures get diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bd0f68b2d6..8a6e8cdb49 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: ./.github/actions/setup-go + with: + go-version: ${{ matrix.go }} - run: ./gomod.sh - run: ./gofmt.sh - run: ./gogenerate.sh @@ -31,6 +33,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: ./.github/actions/setup-go + with: + go-version: ${{ matrix.go }} - run: go build ./... test: @@ -78,4 +82,6 @@ jobs: # Otherwise, the Go test cache will fail (due to the modification time of fixtures changing). fetch-depth: '0' - uses: ./.github/actions/setup-go + with: + go-version: ${{ matrix.go }} - run: go test -race -cover ./... diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index e0396f76ff..87cb7c24ac 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -44,6 +44,8 @@ jobs: # Otherwise, the Go test cache will fail (due to the modification time of fixtures changing). fetch-depth: '0' - uses: ./.github/actions/setup-go + with: + go-version: ${{ matrix.go }} - name: Pull latest Stellar Core image run: docker pull stellar/stellar-core - if: ${{ startsWith(matrix.ingestion-backend, 'captive-core') }} From 6ac58c6a375250010410eac3df088fac576f6782 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 25 Feb 2022 09:51:28 -0800 Subject: [PATCH 66/73] include go version in prefix --- .github/actions/setup-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index e337ef58bc..5a4461619c 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -26,7 +26,7 @@ runs: # The PREFIX must uniquely identify the specific instance of a job executing. - shell: bash - run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV + run: echo 'PREFIX=${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ inputs.go-version }}-matrix(${{ join(matrix.*,'|') }})' >> $GITHUB_ENV # Cache the Go Modules downloaded during the job. - uses: actions/cache@v2 From fcc00d63b041e9c5eee2a021c979cfa43de1554a Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 25 Feb 2022 09:54:30 -0800 Subject: [PATCH 67/73] comments --- .github/actions/setup-go/action.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 5a4461619c..76ba58bb42 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -18,9 +18,12 @@ runs: - name: Restore modification time of checkout files shell: bash run: | - # git-restore-mtime doesn't correct restore the mtime of some directories. - # to make up for it we set a base, fixed modification time of all files - touch -m -t '202201010101' $(find . -type d -not -path '.git/*') + # Set a base, fixed modification time of all directories. + # git-restore-mtime doesn't set the mtime of directories because git + # doesn't store directories, but changing mtimes of directories can + # invalidate the go test cache. + touch -m -t '201509301646' $(find . -type d -not -path '.git/*') + # Restore original modification time from git. sudo apt-get install -y git-restore-mtime git restore-mtime -v From bd48cbb5c9f195c7f8aa0f73c57e347f091b4eb7 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 25 Feb 2022 10:00:57 -0800 Subject: [PATCH 68/73] comment --- .github/actions/setup-go/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 76ba58bb42..1ba236bd5c 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -19,7 +19,8 @@ runs: shell: bash run: | # Set a base, fixed modification time of all directories. - # git-restore-mtime doesn't set the mtime of directories because git + # git-restore-mtime doesn't set the mtime of directories that contain only + # subdirectories because there's no files to infer an mtime and git # doesn't store directories, but changing mtimes of directories can # invalidate the go test cache. touch -m -t '201509301646' $(find . -type d -not -path '.git/*') From bbec97ea7d6cccd31b3ea0577184caffc8372141 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 25 Feb 2022 10:02:52 -0800 Subject: [PATCH 69/73] comments --- .github/actions/setup-go/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 1ba236bd5c..ff251ecbef 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -12,19 +12,19 @@ runs: go-version: ${{ inputs.go-version }} stable: ${{ !(contains(inputs.go-version, 'beta') || contains(inputs.go-version, 'rc')) }} - # Restore original modification time of files based on the date of the most recent commit that modified them. - # `git clone` sets the modification time to the current time, but Go tests that access fixtures get - # invalidated if their modification times change. + # Restore original modification time of files based on the date of the most + # recent commit that modified them as mtimes affect the Go test cache. - name: Restore modification time of checkout files shell: bash run: | # Set a base, fixed modification time of all directories. # git-restore-mtime doesn't set the mtime of directories that contain only # subdirectories because there's no files to infer an mtime and git - # doesn't store directories, but changing mtimes of directories can - # invalidate the go test cache. + # doesn't store directories. touch -m -t '201509301646' $(find . -type d -not -path '.git/*') - # Restore original modification time from git. + # Restore original modification time from git. git clone sets the + # modification time to the current time, but Go tests that access fixtures + # get invalidated if their modification times change. sudo apt-get install -y git-restore-mtime git restore-mtime -v From c6d48b5d6d5bb612ab0ebe39117fd30738fc8339 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 25 Feb 2022 10:04:21 -0800 Subject: [PATCH 70/73] comment --- .github/actions/setup-go/action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index ff251ecbef..d39ca32ef4 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -18,15 +18,13 @@ runs: shell: bash run: | # Set a base, fixed modification time of all directories. - # git-restore-mtime doesn't set the mtime of directories that contain only - # subdirectories because there's no files to infer an mtime and git - # doesn't store directories. + # git-restore-mtime doesn't set the mtime of of all directories. touch -m -t '201509301646' $(find . -type d -not -path '.git/*') # Restore original modification time from git. git clone sets the # modification time to the current time, but Go tests that access fixtures # get invalidated if their modification times change. sudo apt-get install -y git-restore-mtime - git restore-mtime -v + git restore-mtime # The PREFIX must uniquely identify the specific instance of a job executing. - shell: bash From f723a8e91e2d453e8646d9595ee38ba204567fe2 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 19:11:24 +0100 Subject: [PATCH 71/73] comment --- .github/actions/setup-go/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index d39ca32ef4..fb43dbe01a 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -19,6 +19,7 @@ runs: run: | # Set a base, fixed modification time of all directories. # git-restore-mtime doesn't set the mtime of of all directories. + # (see https://github.com/MestreLion/git-tools/issues/47 for details) touch -m -t '201509301646' $(find . -type d -not -path '.git/*') # Restore original modification time from git. git clone sets the # modification time to the current time, but Go tests that access fixtures From 84a86ebfaf4b8b2aab9739469c199ff599f59452 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Fri, 25 Feb 2022 19:15:01 +0100 Subject: [PATCH 72/73] Remove debug output --- .github/workflows/horizon.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/horizon.yml b/.github/workflows/horizon.yml index 87cb7c24ac..240fc73121 100644 --- a/.github/workflows/horizon.yml +++ b/.github/workflows/horizon.yml @@ -60,5 +60,5 @@ jobs: - if: ${{ matrix.ingestion-backend == 'captive-core-remote-storage' }} name: Setup Captive Core Remote Storage run: echo 'HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE_USE_DB=true' >> $GITHUB_ENV - - run: GODEBUG='gocachehash=1,gocachetest=1' go test -race -timeout 25m -v ./services/horizon/internal/integration/... + - run: go test -race -timeout 25m -v ./services/horizon/internal/integration/... From ba651c3c5a020229368675821eb13e7abda3d70e Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:04:40 -0800 Subject: [PATCH 73/73] empty