File tree 3 files changed +60
-8
lines changed
3 files changed +60
-8
lines changed Original file line number Diff line number Diff line change
1
+ name : Build
2
+ on :
3
+ pull_request :
4
+ branches :
5
+ - ' *'
6
+ push :
7
+ branches :
8
+ - " master"
9
+ tags :
10
+ - " !*"
11
+
12
+ jobs :
13
+ build :
14
+ name : Build
15
+ runs-on : ubuntu-latest
16
+
17
+ steps :
18
+ - name : Setup go
19
+ uses : actions/setup-go@v2
20
+ with :
21
+ go-version : 1.15
22
+
23
+ - name : Checkout code
24
+ uses : actions/checkout@v2
25
+
26
+ - name : Build binary
27
+ run : go build -o dist/qlock -ldflags="-s -w -X main.version=$(git describe --tags)" .
28
+
29
+ lint :
30
+ name : Lint
31
+ runs-on : ubuntu-latest
32
+
33
+ steps :
34
+ - name : Setup go
35
+ uses : actions/setup-go@v2
36
+ with :
37
+ go-version : 1.15
38
+
39
+ - name : Checkout code
40
+ uses : actions/checkout@v2
41
+
42
+ - name : Install goimports
43
+ run : cd /tmp && go get -u golang.org/x/tools/cmd/goimports
44
+
45
+ - name : Lint code
46
+ run : make style
Original file line number Diff line number Diff line change
1
+ dist /
Original file line number Diff line number Diff line change 1
- SOURCE ="./src/qlock.py"
2
- TARGET ="/usr/bin/tty-qlock"
1
+ # ### General ####
3
2
3
+ # All target for when make is run on its own.
4
+ .PHONY : all
5
+ all : style
4
6
5
- all : install
7
+ # ### Linting ####
6
8
7
- install :
8
- install -m 755 $(SOURCE ) $(TARGET )
9
-
10
- uninstall :
11
- rm $(TARGET )
9
+ # Format code. Unformatted code will fail in CI.
10
+ .PHONY : style
11
+ style :
12
+ ifdef GITHUB_ACTIONS
13
+ goimports -l .
14
+ else
15
+ goimports -l -w .
16
+ endif
You can’t perform that action at this time.
0 commit comments