This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree 6 files changed +79
-3
lines changed
6 files changed +79
-3
lines changed Original file line number Diff line number Diff line change 9
9
- name : Checkout
10
10
uses : actions/checkout@v1
11
11
- name : Build
12
- run : ./ci/build.sh
12
+ run : ./ci/steps/ build.sh
13
13
- name : Upload
14
14
uses : actions/upload-artifact@v2
15
15
with :
Original file line number Diff line number Diff line change
1
+ name : ci
2
+ on : [push, pull_request]
3
+
4
+ jobs :
5
+ fmt :
6
+ runs-on : ubuntu-latest
7
+ steps :
8
+ - uses : actions/checkout@v1
9
+ - uses : actions/cache@v1
10
+ with :
11
+ path : ~/go/pkg/mod
12
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
13
+ restore-keys : |
14
+ ${{ runner.os }}-go-
15
+ - name : fmt
16
+ uses : ./ci/image
17
+ with :
18
+ args : ./ci/steps/fmt.sh
19
+ lint :
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - uses : actions/checkout@v1
23
+ - uses : actions/cache@v1
24
+ with :
25
+ path : ~/go/pkg/mod
26
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27
+ restore-keys : |
28
+ ${{ runner.os }}-go-
29
+ - name : lint
30
+ uses : ./ci/image
31
+ with :
32
+ args : ./ci/steps/lint.sh
33
+ test :
34
+ runs-on : ubuntu-latest
35
+ steps :
36
+ - uses : actions/checkout@v1
37
+ - uses : actions/cache@v1
38
+ with :
39
+ path : ~/go/pkg/mod
40
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
41
+ restore-keys : |
42
+ ${{ runner.os }}-go-
43
+ - name : test
44
+ uses : ./ci/image
45
+ with :
46
+ args : go test ./...
Original file line number Diff line number Diff line change
1
+ FROM golang:1
2
+
3
+ ENV GOFLAGS="-mod=readonly"
4
+ ENV CI=true
5
+
6
+ RUN go get golang.org/x/tools/cmd/goimports
7
+ RUN go get golang.org/x/lint/golint
8
+ RUN go get github.com/mattn/goveralls
Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ mkdir -p bin
14
14
15
15
build (){
16
16
tmpdir=$( mktemp -d)
17
- go build -ldflags " -s -w -X main.version=${tag} " -o " $tmpdir /coder" ../cmd/coder
17
+ go build -ldflags " -s -w -X main.version=${tag} " -o " $tmpdir /coder" ../../ cmd/coder
18
18
19
19
pushd " $tmpdir "
20
20
tarname=" coder-cli-$GOOS -$GOARCH .tar.gz"
21
21
tar -czf " $tarname " coder
22
22
popd
23
23
24
- cp " $tmpdir /$tarname " bin
24
+ cp " $tmpdir /$tarname " ../ bin
25
25
rm -rf " $tmpdir "
26
26
}
27
27
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ echo " Formatting..."
3
+
4
+ go mod tidy
5
+ gofmt -w -s .
6
+ goimports -w " -local=$$ (go list -m)" .
7
+
8
+ if [ " $CI " != " " ]; then
9
+ if [[ $( git ls-files --other --modified --exclude-standard) != " " ]]; then
10
+ echo " Files need generation or are formatted incorrectly:"
11
+ git -c color.ui=always status | grep --color=no ' \e\[31m'
12
+ echo " Please run the following locally:"
13
+ echo " ./ci/fmt.sh"
14
+ exit 1
15
+ fi
16
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ echo " Linting..."
4
+
5
+ go vet ./...
6
+ golint -set_exit_status ./...
You can’t perform that action at this time.
0 commit comments