Skip to content

Commit ce1829a

Browse files
authored
Merge pull request docker#9675 from glours/update-gh-workflow
use env variable for golang version and updates gh actions from v2 to v3
2 parents 60621dc + dae4231 commit ce1829a

File tree

4 files changed

+50
-81
lines changed

4 files changed

+50
-81
lines changed

.github/workflows/artifacts.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Publish Artifacts
2+
env:
3+
GO_VERSION: 1.18.4
24
on:
35
issue_comment:
46
types: [created]
@@ -7,49 +9,44 @@ jobs:
79
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/generate-artifacts')
810
runs-on: ubuntu-latest
911
steps:
10-
- name: Set up Go 1.18
11-
uses: actions/setup-go@v2
12-
with:
13-
go-version: 1.18.4
14-
id: go
15-
1612
- name: Checkout code into the Go module directory
17-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1814

19-
- uses: actions/cache@v2
15+
- name: Set up Go ${{ env.GO_VERSION }}
16+
uses: actions/setup-go@v3
2017
with:
21-
path: ~/go/pkg/mod
22-
key: go-${{ hashFiles('**/go.sum') }}
18+
go-version: ${{ env.GO_VERSION }}
19+
cache: true
2320

2421
- name: Build cross platform compose-plugin binaries
2522
run: make -f builder.Makefile cross
2623

2724
- name: Upload macos-amd64 binary
28-
uses: actions/upload-artifact@v2
25+
uses: actions/upload-artifact@v3
2926
with:
3027
name: docker-compose-darwin-amd64
3128
path: ${{ github.workspace }}/bin/docker-compose-darwin-amd64
3229

3330
- name: Upload macos-arm64 binary
34-
uses: actions/upload-artifact@v2
31+
uses: actions/upload-artifact@v3
3532
with:
3633
name: docker-compose-darwin-arm64
3734
path: ${{ github.workspace }}/bin/docker-compose-darwin-arm64
3835

3936
- name: Upload linux-amd64 binary
40-
uses: actions/upload-artifact@v2
37+
uses: actions/upload-artifact@v3
4138
with:
4239
name: docker-compose-linux-amd64
4340
path: ${{ github.workspace }}/bin/docker-compose-linux-amd64
4441

4542
- name: Upload linux-ppc64le binary
46-
uses: actions/upload-artifact@v2
43+
uses: actions/upload-artifact@v3
4744
with:
4845
name: docker-compose-linux-ppc64le
4946
path: ${{ github.workspace }}/bin/docker-compose-linux-ppc64le
5047

5148
- name: Upload windows-amd64 binary
52-
uses: actions/upload-artifact@v2
49+
uses: actions/upload-artifact@v3
5350
with:
5451
name: docker-compose-windows-amd64.exe
5552
path: ${{ github.workspace }}/bin/docker-compose-windows-amd64.exe

.github/workflows/ci.yml

Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@ on:
1111
description: 'To run with tmate enter "debug_enabled"'
1212
required: false
1313
default: "false"
14-
14+
env:
15+
GO_VERSION: 1.18.4
1516
jobs:
1617
lint:
1718
name: Lint
1819
runs-on: ubuntu-latest
19-
env:
20-
GO111MODULE: "on"
2120
steps:
22-
- name: Set up Go 1.18
23-
uses: actions/setup-go@v2
24-
with:
25-
go-version: 1.18.4
26-
id: go
27-
2821
- name: Checkout code into the Go module directory
29-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Go ${{ env.GO_VERSION }}
25+
uses: actions/setup-go@v3
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
cache: true
3029

3130
- name: Validate go-mod, license headers and docs are up-to-date
3231
run: make validate
@@ -43,22 +42,15 @@ jobs:
4342
name: Validate cross build
4443
runs-on: ubuntu-latest
4544
if: github.ref == 'refs/heads/main'
46-
env:
47-
GO111MODULE: "on"
4845
steps:
49-
- name: Set up Go 1.18
50-
uses: actions/setup-go@v2
51-
with:
52-
go-version: 1.18.4
53-
id: go
54-
5546
- name: Checkout code into the Go module directory
56-
uses: actions/checkout@v2
47+
uses: actions/checkout@v3
5748

58-
- uses: actions/cache@v2
49+
- name: Set up Go ${{ env.GO_VERSION }}
50+
uses: actions/setup-go@v3
5951
with:
60-
path: ~/go/pkg/mod
61-
key: go-${{ hashFiles('**/go.sum') }}
52+
go-version: ${{ env.GO_VERSION }}
53+
cache: true
6254

6355
# Ensure we don't discover cross platform build issues at release time.
6456
# Time used to build linux here is gained back in the build for local E2E step
@@ -68,28 +60,21 @@ jobs:
6860
build-plugin:
6961
name: Build and tests in plugin mode
7062
runs-on: ubuntu-latest
71-
env:
72-
GO111MODULE: "on"
7363
steps:
74-
- name: Set up Go 1.18
75-
uses: actions/setup-go@v2
64+
- name: Checkout code into the Go module directory
65+
uses: actions/checkout@v3
66+
67+
- name: Set up Go ${{ env.GO_VERSION }}
68+
uses: actions/setup-go@v3
7669
with:
77-
go-version: 1.18.4
78-
id: go
70+
go-version: ${{ env.GO_VERSION }}
71+
cache: true
7972

8073
- name: Setup docker CLI
8174
run: |
8275
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
8376
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
8477
85-
- name: Checkout code into the Go module directory
86-
uses: actions/checkout@v2
87-
88-
- uses: actions/cache@v2
89-
with:
90-
path: ~/go/pkg/mod
91-
key: go-${{ hashFiles('**/go.sum') }}
92-
9378
- name: Test
9479
run: make -f builder.Makefile test
9580

@@ -104,28 +89,21 @@ jobs:
10489
build-standalone:
10590
name: Build and tests in standalone mode
10691
runs-on: ubuntu-latest
107-
env:
108-
GO111MODULE: "on"
10992
steps:
110-
- name: Set up Go 1.18
111-
uses: actions/setup-go@v2
93+
- name: Checkout code into the Go module directory
94+
uses: actions/checkout@v3
95+
96+
- name: Set up Go ${{ env.GO_VERSION }}
97+
uses: actions/setup-go@v3
11298
with:
113-
go-version: 1.18.4
114-
id: go
99+
go-version: ${{ env.GO_VERSION }}
100+
cache: true
115101

116102
- name: Setup docker CLI
117103
run: |
118104
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
119105
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
120106
121-
- name: Checkout code into the Go module directory
122-
uses: actions/checkout@v2
123-
124-
- uses: actions/cache@v2
125-
with:
126-
path: ~/go/pkg/mod
127-
key: go-${{ hashFiles('**/go.sum') }}
128-
129107
- name: Build for local E2E
130108
env:
131109
BUILD_TAGS: e2e

.github/workflows/rebase.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout the latest code
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
with:
1414
token: ${{ secrets.GITHUB_TOKEN }}
1515
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

.github/workflows/release.yaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,26 @@ on:
66
tag:
77
description: "Release Tag"
88
required: true
9-
9+
env:
10+
GO_VERSION: 1.18.4
1011
jobs:
1112
upload-release:
1213
runs-on: ubuntu-latest
1314
steps:
14-
- name: Set up Go 1.18
15-
uses: actions/setup-go@v2
15+
- name: Checkout code into the Go module directory
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Go ${{ env.GO_VERSION }}
19+
uses: actions/setup-go@v3
1620
with:
17-
go-version: 1.18.4
18-
id: go
21+
go-version: ${{ env.GO_VERSION }}
22+
cache: true
1923

2024
- name: Setup docker CLI
2125
run: |
2226
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
2327
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
2428
25-
- name: Checkout code into the Go module directory
26-
uses: actions/checkout@v2
27-
28-
- uses: actions/cache@v2
29-
with:
30-
path: ~/go/pkg/mod
31-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
32-
restore-keys: |
33-
${{ runner.os }}-go-
34-
3529
- name: Build
3630
run: make GIT_TAG=${{ github.event.inputs.tag }} -f builder.Makefile cross
3731

0 commit comments

Comments
 (0)