Skip to content

Commit 3e864af

Browse files
authored
Merge branch 'main' into get-more-data-from-runtime
2 parents f56ae88 + 2342d78 commit 3e864af

File tree

6 files changed

+233
-166
lines changed

6 files changed

+233
-166
lines changed

.github/workflows/ci.yaml

Lines changed: 60 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
os:
24-
- ubuntu-latest
24+
- ubuntu-20.04
2525
go-version:
2626
- 1.13.x
2727
- 1.14.x
@@ -40,14 +40,29 @@ jobs:
4040
env:
4141
# no `-mod=readonly` to test PRs made by @dependabot;
4242
# `make ci-check-changes` step below still checks what we need
43+
WORKDIR: "${{ github.workspace }}/gopath/src/gopkg.in/reform.v1"
44+
GOPATH: "${{ github.workspace }}/gopath"
45+
GOBIN: "${{ github.workspace }}/gopath/bin"
4346
GO111MODULE: "on"
44-
GOPROXY: https://proxy.golang.org
45-
GORACE: halt_on_error=1
46-
REFORM_POSTGRES_IMAGE: ${{ matrix.images.postgres }}
47-
REFORM_MYSQL_IMAGE: ${{ matrix.images.mysql }}
48-
REFORM_MSSQL_IMAGE: ${{ matrix.images.mssql }}
47+
GOPROXY: "https://proxy.golang.org"
48+
GORACE: "halt_on_error=1"
49+
REFORM_POSTGRES_IMAGE: "${{ matrix.images.postgres }}"
50+
REFORM_MYSQL_IMAGE: "${{ matrix.images.mysql }}"
51+
REFORM_MSSQL_IMAGE: "${{ matrix.images.mssql }}"
4952

5053
steps:
54+
# Cache Go modules, build cache, installed packages and GOPATH sources
55+
# to significantly decreases total CI time. See also cleanup.yaml.
56+
- name: Enable Go cache
57+
uses: actions/cache@v2
58+
with:
59+
path: |
60+
~/.cache/go-build
61+
${{ env.GOPATH }}/pkg
62+
${{ env.GOPATH }}/src/github.com
63+
${{ env.GOPATH }}/src/golang.org
64+
key: ${{ matrix.os }}-${{ matrix.go-version }}
65+
5166
- name: Set up Go version ${{ matrix.go-version }}
5267
if: matrix.go-version != 'tip'
5368
uses: actions/setup-go@v2
@@ -60,43 +75,21 @@ jobs:
6075
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
6176
cd $HOME/gotip/src
6277
./make.bash
63-
echo "::set-env name=GOROOT::$HOME/gotip"
64-
echo "::add-path::$HOME/gotip/bin"
78+
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
79+
echo "$HOME/gotip/bin" >> $GITHUB_PATH
80+
echo "$GOBIN" >> $GITHUB_PATH
6581
66-
- name: Set environment variables
67-
run: |
68-
echo "::set-env name=GOPATH::$GITHUB_WORKSPACE/gopath"
69-
echo "::add-path::$GITHUB_WORKSPACE/gopath/bin"
70-
echo "::set-env name=WORKDIR::$GITHUB_WORKSPACE/gopath/src/gopkg.in/reform.v1"
71-
echo "::set-env name=GO_VERSION::$(go version)"
82+
- name: Set GO_VERSION
83+
run: echo "GO_VERSION=$(go version)" >> $GITHUB_ENV
7284

7385
- name: Check out code into GOPATH
7486
uses: actions/checkout@v2
7587
with:
7688
path: ${{ env.WORKDIR }}
7789

78-
- name: Pull Docker images in the background
90+
- name: Pull Docker images
7991
working-directory: ${{ env.WORKDIR }}
80-
run: docker-compose pull --quiet &
81-
82-
# slightly decreases total CI time; see also cleanup.yaml
83-
- name: Enable Go modules cache
84-
uses: actions/cache@v2
85-
with:
86-
path: ${{ env.GOPATH }}/pkg/mod
87-
key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }}
88-
restore-keys: |
89-
${{ matrix.os }}-go-${{ matrix.go-version }}-modules-
90-
91-
# significantly decreases total CI time; see also cleanup.yaml
92-
- name: Enable Go build cache
93-
uses: actions/cache@v2
94-
with:
95-
path: ~/.cache/go-build
96-
key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }}
97-
restore-keys: |
98-
${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-
99-
${{ matrix.os }}-go-${{ matrix.go-version }}-build-
92+
run: docker-compose pull
10093

10194
- name: Stop Ubuntu services
10295
run: sudo systemctl stop mysql
@@ -113,7 +106,7 @@ jobs:
113106
- name: Check that it is still possible to install reform without modules
114107
working-directory: ${{ env.WORKDIR }}
115108
run: |
116-
env GO111MODULE=off go get -v ./...
109+
env GO111MODULE=off go get -v -x ./...
117110
reform -version
118111
reform-db -version
119112
@@ -131,6 +124,10 @@ jobs:
131124

132125
# TODO test again with updated deps
133126

127+
- name: Clean Go test cache
128+
if: ${{ always() }}
129+
run: go clean -testcache
130+
134131
# to ensure that all generators still work the same way
135132
- name: Check that there are no source code changes
136133
working-directory: ${{ env.WORKDIR }}
@@ -162,20 +159,38 @@ jobs:
162159
fail-fast: false
163160
matrix:
164161
os:
165-
- ubuntu-latest
162+
- ubuntu-20.04
166163
go-version:
167164
- 1.15.x
168165

169166
runs-on: ${{ matrix.os }}
170167

171168
env:
172-
# no `-mod=readonly` to test PRs made by @dependabot
169+
# no `-mod=readonly` to test PRs made by @dependabot;
173170
# `make ci-check-changes` step below still checks what we need
171+
WORKDIR: "${{ github.workspace }}/gopath/src/gopkg.in/reform.v1"
172+
GOPATH: "${{ github.workspace }}/gopath"
173+
GOBIN: "${{ github.workspace }}/gopath/bin"
174174
GO111MODULE: "on"
175-
GOPROXY: https://proxy.golang.org
176-
GORACE: halt_on_error=1
175+
GOPROXY: "https://proxy.golang.org"
176+
GORACE: "halt_on_error=1"
177+
REFORM_POSTGRES_IMAGE: "${{ matrix.images.postgres }}"
178+
REFORM_MYSQL_IMAGE: "${{ matrix.images.mysql }}"
179+
REFORM_MSSQL_IMAGE: "${{ matrix.images.mssql }}"
177180

178181
steps:
182+
# Cache Go modules, build cache, installed packages and GOPATH sources
183+
# to significantly decreases total CI time. See also cleanup.yaml.
184+
- name: Enable Go cache
185+
uses: actions/cache@v2
186+
with:
187+
path: |
188+
~/.cache/go-build
189+
${{ env.GOPATH }}/pkg
190+
${{ env.GOPATH }}/src/github.com
191+
${{ env.GOPATH }}/src/golang.org
192+
key: ${{ matrix.os }}-${{ matrix.go-version }}
193+
179194
- name: Set up Go version ${{ matrix.go-version }}
180195
if: matrix.go-version != 'tip'
181196
uses: actions/setup-go@v2
@@ -188,40 +203,18 @@ jobs:
188203
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
189204
cd $HOME/gotip/src
190205
./make.bash
191-
echo "::set-env name=GOROOT::$HOME/gotip"
192-
echo "::add-path::$HOME/gotip/bin"
206+
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
207+
echo "$HOME/gotip/bin" >> $GITHUB_PATH
208+
echo "$GOBIN" >> $GITHUB_PATH
193209
194-
- name: Set environment variables
195-
run: |
196-
echo "::set-env name=GOPATH::$GITHUB_WORKSPACE/gopath"
197-
echo "::add-path::$GITHUB_WORKSPACE/gopath/bin"
198-
echo "::set-env name=WORKDIR::$GITHUB_WORKSPACE/gopath/src/gopkg.in/reform.v1"
199-
echo "::set-env name=GO_VERSION::$(go version)"
210+
- name: Set GO_VERSION
211+
run: echo "GO_VERSION=$(go version)" >> $GITHUB_ENV
200212

201213
- name: Check out code into GOPATH
202214
uses: actions/checkout@v2
203215
with:
204216
path: ${{ env.WORKDIR }}
205217

206-
# slightly decreases total CI time; see also cleanup.yaml
207-
- name: Enable Go modules cache
208-
uses: actions/cache@v2
209-
with:
210-
path: ${{ env.GOPATH }}/pkg/mod
211-
key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }}
212-
restore-keys: |
213-
${{ matrix.os }}-go-${{ matrix.go-version }}-modules-
214-
215-
# significantly decreases total CI time; see also cleanup.yaml
216-
- name: Enable Go build cache
217-
uses: actions/cache@v2
218-
with:
219-
path: ~/.cache/go-build
220-
key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }}
221-
restore-keys: |
222-
${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-
223-
${{ matrix.os }}-go-${{ matrix.go-version }}-build-
224-
225218
# FIXME Is there a more ergonomic way?
226219
- name: Update Go language version in the module
227220
working-directory: ${{ env.WORKDIR }}

.github/workflows/cleanup.yaml

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
os:
17-
- ubuntu-latest
17+
- ubuntu-20.04
1818
go-version:
1919
- 1.13.x
2020
- 1.14.x
@@ -24,10 +24,25 @@ jobs:
2424
runs-on: ${{ matrix.os }}
2525

2626
env:
27+
WORKDIR: "${{ github.workspace }}/gopath/src/gopkg.in/reform.v1"
28+
GOPATH: "${{ github.workspace }}/gopath"
29+
GOBIN: "${{ github.workspace }}/gopath/bin"
2730
GO111MODULE: "on"
28-
GOPROXY: https://proxy.golang.org
31+
GOPROXY: "https://proxy.golang.org"
2932

3033
steps:
34+
# Cache Go modules, build cache, installed packages and GOPATH sources
35+
# to significantly decreases total CI time. See also cleanup.yaml.
36+
- name: Enable Go cache
37+
uses: actions/cache@v2
38+
with:
39+
path: |
40+
~/.cache/go-build
41+
${{ env.GOPATH }}/pkg
42+
${{ env.GOPATH }}/src/github.com
43+
${{ env.GOPATH }}/src/golang.org
44+
key: ${{ matrix.os }}-${{ matrix.go-version }}
45+
3146
- name: Set up Go version ${{ matrix.go-version }}
3247
if: matrix.go-version != 'tip'
3348
uses: actions/setup-go@v2
@@ -40,40 +55,17 @@ jobs:
4055
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
4156
cd $HOME/gotip/src
4257
./make.bash
43-
echo "::set-env name=GOROOT::$HOME/gotip"
44-
echo "::add-path::$HOME/gotip/bin"
45-
46-
- name: Set environment variables
47-
run: |
48-
echo "::set-env name=GOPATH::$GITHUB_WORKSPACE/gopath"
49-
echo "::add-path::$GITHUB_WORKSPACE/gopath/bin"
50-
echo "::set-env name=WORKDIR::$GITHUB_WORKSPACE/gopath/src/gopkg.in/reform.v1"
51-
echo "::set-env name=GO_VERSION::$(go version)"
58+
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
59+
echo "$HOME/gotip/bin" >> $GITHUB_PATH
60+
echo "$GOBIN" >> $GITHUB_PATH
5261
5362
- name: Check out code into GOPATH
5463
uses: actions/checkout@v2
5564
with:
5665
path: ${{ env.WORKDIR }}
5766

58-
- name: Enable Go modules cache
59-
uses: actions/cache@v2
60-
with:
61-
path: ${{ env.GOPATH }}/pkg/mod
62-
key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }}
63-
restore-keys: |
64-
${{ matrix.os }}-go-${{ matrix.go-version }}-modules-
65-
66-
- name: Enable Go build cache
67-
uses: actions/cache@v2
68-
with:
69-
path: ~/.cache/go-build
70-
key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }}
71-
restore-keys: |
72-
${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-
73-
${{ matrix.os }}-go-${{ matrix.go-version }}-build-
74-
75-
- name: Clean Go modules cache
76-
run: go clean -modcache
77-
78-
- name: Clean Go build cache
79-
run: go clean -cache
67+
- name: Clean Go cache
68+
run: |
69+
go clean -modcache
70+
go clean -cache
71+
rm -fr ${{ env.GOPATH }}

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/AlekSi/pointer v1.1.0
77
github.com/brianvoe/gofakeit v3.18.0+incompatible
88
github.com/cockroachdb/apd v1.1.0 // indirect
9-
github.com/denisenkom/go-mssqldb v0.0.0-20200620013148-b91950f658ec
9+
github.com/denisenkom/go-mssqldb v0.9.0
1010
github.com/go-sql-driver/mysql v1.5.0
1111
github.com/gofrs/uuid v3.3.0+incompatible // indirect
1212
github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect
@@ -16,4 +16,5 @@ require (
1616
github.com/pkg/errors v0.9.1 // indirect
1717
github.com/shopspring/decimal v1.2.0 // indirect
1818
github.com/stretchr/testify v1.6.1
19+
golang.org/x/text v0.3.4 // indirect
1920
)

go.sum

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I
88
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
99
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
1010
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
11-
github.com/denisenkom/go-mssqldb v0.0.0-20200620013148-b91950f658ec h1:NfhRXXFDPxcF5Cwo06DzeIaE7uuJtAUhsDwH3LNsjos=
12-
github.com/denisenkom/go-mssqldb v0.0.0-20200620013148-b91950f658ec/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
11+
github.com/denisenkom/go-mssqldb v0.9.0 h1:RSohk2RsiZqLZ0zCjtfn3S4Gp4exhpBWHyQ7D0yGjAk=
12+
github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
1313
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
1414
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
1515
github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84=
@@ -41,8 +41,10 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL
4141
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
4242
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
4343
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
44-
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
4544
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
45+
golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
46+
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
47+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
4648
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
4749
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4850
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=

tools/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.13
44

55
require (
66
github.com/AlekSi/gocoverutil v0.2.0
7-
github.com/golangci/golangci-lint v1.31.0
7+
github.com/golangci/golangci-lint v1.32.2
88
github.com/quasilyte/go-consistent v0.0.0-20200404105227-766526bf1e96
9-
github.com/reviewdog/reviewdog v0.10.1
10-
golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0
9+
github.com/reviewdog/reviewdog v0.11.0
10+
golang.org/x/tools v0.0.0-20201119054027-25dc3e1ccc3c
1111
)

0 commit comments

Comments
 (0)