-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
95 lines (80 loc) · 2.38 KB
/
Justfile
File metadata and controls
95 lines (80 loc) · 2.38 KB
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
# -*- Justfile -*-
coverage_file := "coverage.out"
# List the available justfile recipes.
[group('general')]
@default:
just --list --unsorted
# List the lines of code in the project.
[group('general')]
loc:
scc --remap-unknown "-*- Justfile -*-":"justfile"
# View documentation in web browser using pkgsite.
[group('general')]
docs:
pkgsite -open .
# Format and vet Go code. Runs before tests.
[group('test')]
check:
go fmt ./...
go vet ./...
# Lint using golangci-lint
[group('test')]
lint:
golangci-lint run --config .golangci.yaml
# Run the unit tests.
[group('test')]
unit *FLAGS: check
go test ./... -cover -vet=off -race {{FLAGS}} -short
# HTML report for unit (default), int, e2e, or all tests.
[group('test')]
cover test='unit': check
go test ./... -vet=off -coverprofile={{coverage_file}} \
{{ if test == 'all' { '' } \
else if test == 'int' { '-run Integration' } \
else if test == 'e2e' { '-run E2E' } \
else { '-short' } }}
go tool cover -html={{coverage_file}}
# List the outdated direct dependencies (slow to run).
[group('dependencies')]
outdated:
# (requires https://github.com/psampaz/go-mod-outdated).
go list -u -m -json all | go-mod-outdated -update -direct
# Update the given module to the latest version.
[group('dependencies')]
update mod:
go get -u {{mod}}
go mod tidy
# Update all modules.
[group('dependencies')]
updateall:
go get -u ./...
go mod tidy
# Run go mod tidy and verify.
[group('dependencies')]
tidy:
go mod tidy
go mod verify
# Run the Prologix VCP GPIB Keysight E3631A example application.
[group('examples')]
key3631 port gpib:
#!/usr/bin/env bash
echo '# Prologix VCP GPIB Keysight E3631A Example Application'
cd {{justfile_directory()}}/examples/vcp/e3631a
env go build -o e3631a
./e3631a -port={{port}} -gpib={{gpib}}
# Run the Prologix VCP GPIB Keysight 33220A example application.
[group('examples')]
key33220 port gpib:
#!/usr/bin/env bash
echo '# Prologix VCP GPIB Keysight 33220A Example Application'
cd {{justfile_directory()}}/examples/vcp/key33220a
env go build -o key33220a
./key33220a -port={{port}} -gpib={{gpib}}
# Run the Prologix VCP GPIB SRS DS345 example application.
[group('examples')]
ds345 port gpib:
#!/usr/bin/env bash
echo '# Prologix VCP GPIB SRS DS345 Example Application'
cd {{justfile_directory()}}/examples/vcp/ds345
env go build -o ds345
./ds345 -port={{port}} -gpib={{gpib}}