-
Notifications
You must be signed in to change notification settings - Fork 617
109 lines (105 loc) · 3.62 KB
/
static.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Static Checks
on: [push, pull_request]
permissions: read-all
jobs:
static-check:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: src/github.com/aws/amazon-ecs-agent
- name: get GO_VERSION
id: get-go-version
run: |
cd $GITHUB_WORKSPACE/src/github.com/aws/amazon-ecs-agent
set -eou pipefail
go_version=$(cat GO_VERSION | tr -d '\n')
go_version_length=${#go_version}
go_version_re="^([0-9]+\.){1,2}([0-9]+)$"
if ! [[ $go_version_length -le 10 && $go_version =~ $go_version_re ]] ; then
echo "invalid GO version"
exit 1
fi
echo "GO_VERSION=$go_version" >> $GITHUB_OUTPUT
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.get-go-version.outputs.GO_VERSION }}
- uses: actions/checkout@v3
with:
path: src/github.com/aws/amazon-ecs-agent
- name: run static checks
run: |
export GOPATH=$GITHUB_WORKSPACE
export PATH=$PATH:$(go env GOPATH)/bin
export GO111MODULE=auto
cd $GITHUB_WORKSPACE/src/github.com/aws/amazon-ecs-agent
make get-deps
make static-check
init-check:
name: Static Analysis Init
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: src/github.com/aws/amazon-ecs-agent
- name: get GO_VERSION
id: get-go-version
run: |
cd $GITHUB_WORKSPACE/src/github.com/aws/amazon-ecs-agent
set -eou pipefail
go_version=$(cat GO_VERSION | tr -d '\n')
go_version_length=${#go_version}
go_version_re="^([0-9]+\.){1,2}([0-9]+)$"
if ! [[ $go_version_length -le 10 && $go_version =~ $go_version_re ]] ; then
echo "invalid GO version"
exit 1
fi
echo "GO_VERSION=$go_version" >> $GITHUB_OUTPUT
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.get-go-version.outputs.GO_VERSION }}
- uses: actions/checkout@v3
with:
path: src/github.com/aws/amazon-ecs-agent
- name: run static checks
run: |
export GOPATH=$GITHUB_WORKSPACE
export PATH=$PATH:$(go env GOPATH)/bin
export GO111MODULE=auto
cd $GITHUB_WORKSPACE/src/github.com/aws/amazon-ecs-agent
make get-deps-init
make static-check-init
x-platform-build:
name: Cross platform build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: src/github.com/aws/amazon-ecs-agent
- name: get GO_VERSION
id: get-go-version
run: |
cd $GITHUB_WORKSPACE/src/github.com/aws/amazon-ecs-agent
set -eou pipefail
go_version=$(cat GO_VERSION | tr -d '\n')
go_version_length=${#go_version}
go_version_re="^([0-9]+\.){1,2}([0-9]+)$"
if ! [[ $go_version_length -le 10 && $go_version =~ $go_version_re ]] ; then
echo "invalid GO version"
exit 1
fi
echo "GO_VERSION=$go_version" >> $GITHUB_OUTPUT
- uses: actions/setup-go@v3
with:
go-version: ${{ steps.get-go-version.outputs.GO_VERSION }}
- uses: actions/checkout@v3
with:
submodules: true
path: src/github.com/aws/amazon-ecs-agent
- name: make xplatform-build
run: |
export GOPATH=$GITHUB_WORKSPACE
export GO111MODULE=auto
cd $GITHUB_WORKSPACE/src/github.com/aws/amazon-ecs-agent
make xplatform-build