Skip to content

Commit 3d162df

Browse files
author
noah
committed
Add CI
1 parent b58a01b commit 3d162df

File tree

3 files changed

+135
-4
lines changed

3 files changed

+135
-4
lines changed

.github/workflows/test.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
go-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
-
14+
uses: actions/checkout@v2
15+
-
16+
name: golangci-lint
17+
uses: golangci/golangci-lint-action@v2
18+
with:
19+
version: v1.41
20+
args: -D errcheck --timeout 2m
21+
-
22+
uses: actions/setup-go@v1
23+
with:
24+
go-version: '1.17'
25+
-
26+
run: go test -cpu 4 -coverprofile .testCoverage.txt ./...
27+
env:
28+
GIN_MODE: release

.testCoverage.txt

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
mode: set
2+
github.com/gitploy-io/cronexpr/parser.go:58.39,60.16 2 1
3+
github.com/gitploy-io/cronexpr/parser.go:64.2,64.10 1 1
4+
github.com/gitploy-io/cronexpr/parser.go:60.16,61.13 1 0
5+
github.com/gitploy-io/cronexpr/parser.go:67.44,69.16 2 1
6+
github.com/gitploy-io/cronexpr/parser.go:73.2,79.80 3 1
7+
github.com/gitploy-io/cronexpr/parser.go:83.2,83.76 1 1
8+
github.com/gitploy-io/cronexpr/parser.go:87.2,87.74 1 1
9+
github.com/gitploy-io/cronexpr/parser.go:91.2,91.81 1 1
10+
github.com/gitploy-io/cronexpr/parser.go:95.2,95.75 1 1
11+
github.com/gitploy-io/cronexpr/parser.go:99.2,105.8 1 1
12+
github.com/gitploy-io/cronexpr/parser.go:69.16,71.3 1 0
13+
github.com/gitploy-io/cronexpr/parser.go:79.80,81.3 1 0
14+
github.com/gitploy-io/cronexpr/parser.go:83.76,85.3 1 0
15+
github.com/gitploy-io/cronexpr/parser.go:87.74,89.3 1 0
16+
github.com/gitploy-io/cronexpr/parser.go:91.81,93.3 1 0
17+
github.com/gitploy-io/cronexpr/parser.go:95.75,97.3 1 0
18+
github.com/gitploy-io/cronexpr/parser.go:110.70,115.39 3 1
19+
github.com/gitploy-io/cronexpr/parser.go:124.2,124.21 1 1
20+
github.com/gitploy-io/cronexpr/parser.go:115.39,117.17 2 1
21+
github.com/gitploy-io/cronexpr/parser.go:121.3,121.24 1 1
22+
github.com/gitploy-io/cronexpr/parser.go:117.17,119.4 1 1
23+
github.com/gitploy-io/cronexpr/parser.go:129.78,134.57 3 1
24+
github.com/gitploy-io/cronexpr/parser.go:138.2,144.2 3 1
25+
github.com/gitploy-io/cronexpr/parser.go:173.2,174.13 2 1
26+
github.com/gitploy-io/cronexpr/parser.go:181.2,181.43 1 1
27+
github.com/gitploy-io/cronexpr/parser.go:134.57,136.3 1 0
28+
github.com/gitploy-io/cronexpr/parser.go:144.2,146.54 2 1
29+
github.com/gitploy-io/cronexpr/parser.go:150.3,151.17 2 1
30+
github.com/gitploy-io/cronexpr/parser.go:155.3,158.38 2 1
31+
github.com/gitploy-io/cronexpr/parser.go:146.54,148.4 1 1
32+
github.com/gitploy-io/cronexpr/parser.go:151.17,153.4 1 0
33+
github.com/gitploy-io/cronexpr/parser.go:158.38,160.4 1 1
34+
github.com/gitploy-io/cronexpr/parser.go:160.9,160.46 1 1
35+
github.com/gitploy-io/cronexpr/parser.go:160.46,162.4 1 1
36+
github.com/gitploy-io/cronexpr/parser.go:162.9,162.34 1 1
37+
github.com/gitploy-io/cronexpr/parser.go:162.34,164.18 2 1
38+
github.com/gitploy-io/cronexpr/parser.go:168.4,168.14 1 1
39+
github.com/gitploy-io/cronexpr/parser.go:164.18,166.5 1 0
40+
github.com/gitploy-io/cronexpr/parser.go:174.13,176.60 2 1
41+
github.com/gitploy-io/cronexpr/parser.go:176.60,178.4 1 0
42+
github.com/gitploy-io/cronexpr/parser.go:184.52,185.43 1 1
43+
github.com/gitploy-io/cronexpr/parser.go:189.2,190.9 2 1
44+
github.com/gitploy-io/cronexpr/parser.go:194.2,194.15 1 1
45+
github.com/gitploy-io/cronexpr/parser.go:185.43,187.3 1 1
46+
github.com/gitploy-io/cronexpr/parser.go:190.9,192.3 1 0
47+
github.com/gitploy-io/cronexpr/parser.go:197.45,200.36 2 1
48+
github.com/gitploy-io/cronexpr/parser.go:204.2,204.10 1 1
49+
github.com/gitploy-io/cronexpr/parser.go:200.36,202.3 1 1
50+
github.com/gitploy-io/cronexpr/parser.go:207.36,209.22 2 1
51+
github.com/gitploy-io/cronexpr/parser.go:213.2,213.12 1 1
52+
github.com/gitploy-io/cronexpr/parser.go:209.22,211.3 1 0
53+
github.com/gitploy-io/cronexpr/schedule.go:16.48,26.1 5 1
54+
github.com/gitploy-io/cronexpr/schedule.go:27.2,27.26 1 1
55+
github.com/gitploy-io/cronexpr/schedule.go:33.2,34.38 2 1
56+
github.com/gitploy-io/cronexpr/schedule.go:49.2,50.24 2 1
57+
github.com/gitploy-io/cronexpr/schedule.go:63.2,64.36 2 1
58+
github.com/gitploy-io/cronexpr/schedule.go:77.2,78.40 2 1
59+
github.com/gitploy-io/cronexpr/schedule.go:91.2,91.10 1 1
60+
github.com/gitploy-io/cronexpr/schedule.go:27.26,29.3 1 0
61+
github.com/gitploy-io/cronexpr/schedule.go:34.38,36.13 1 1
62+
github.com/gitploy-io/cronexpr/schedule.go:41.3,43.23 2 1
63+
github.com/gitploy-io/cronexpr/schedule.go:36.13,39.4 2 1
64+
github.com/gitploy-io/cronexpr/schedule.go:43.23,44.10 1 0
65+
github.com/gitploy-io/cronexpr/schedule.go:50.24,51.13 1 1
66+
github.com/gitploy-io/cronexpr/schedule.go:56.3,58.25 2 1
67+
github.com/gitploy-io/cronexpr/schedule.go:51.13,54.4 2 0
68+
github.com/gitploy-io/cronexpr/schedule.go:58.25,59.10 1 1
69+
github.com/gitploy-io/cronexpr/schedule.go:64.36,65.13 1 1
70+
github.com/gitploy-io/cronexpr/schedule.go:70.3,72.21 2 1
71+
github.com/gitploy-io/cronexpr/schedule.go:65.13,68.4 2 1
72+
github.com/gitploy-io/cronexpr/schedule.go:72.21,73.10 1 1
73+
github.com/gitploy-io/cronexpr/schedule.go:78.40,79.13 1 1
74+
github.com/gitploy-io/cronexpr/schedule.go:84.3,86.23 2 1
75+
github.com/gitploy-io/cronexpr/schedule.go:79.13,82.4 2 1
76+
github.com/gitploy-io/cronexpr/schedule.go:86.23,87.10 1 1
77+
github.com/gitploy-io/cronexpr/schedule.go:94.48,104.1 5 1
78+
github.com/gitploy-io/cronexpr/schedule.go:105.2,105.26 1 1
79+
github.com/gitploy-io/cronexpr/schedule.go:109.2,110.38 2 1
80+
github.com/gitploy-io/cronexpr/schedule.go:128.2,129.24 2 1
81+
github.com/gitploy-io/cronexpr/schedule.go:142.2,143.36 2 1
82+
github.com/gitploy-io/cronexpr/schedule.go:156.2,157.40 2 1
83+
github.com/gitploy-io/cronexpr/schedule.go:170.2,170.10 1 1
84+
github.com/gitploy-io/cronexpr/schedule.go:105.26,107.3 1 0
85+
github.com/gitploy-io/cronexpr/schedule.go:110.38,112.18 1 1
86+
github.com/gitploy-io/cronexpr/schedule.go:120.3,122.23 2 1
87+
github.com/gitploy-io/cronexpr/schedule.go:112.18,115.4 2 1
88+
github.com/gitploy-io/cronexpr/schedule.go:122.23,123.10 1 1
89+
github.com/gitploy-io/cronexpr/schedule.go:129.24,130.18 1 1
90+
github.com/gitploy-io/cronexpr/schedule.go:135.3,137.25 2 1
91+
github.com/gitploy-io/cronexpr/schedule.go:130.18,133.4 2 1
92+
github.com/gitploy-io/cronexpr/schedule.go:137.25,138.10 1 1
93+
github.com/gitploy-io/cronexpr/schedule.go:143.36,144.18 1 1
94+
github.com/gitploy-io/cronexpr/schedule.go:149.3,151.21 2 1
95+
github.com/gitploy-io/cronexpr/schedule.go:144.18,147.4 2 0
96+
github.com/gitploy-io/cronexpr/schedule.go:151.21,152.10 1 0
97+
github.com/gitploy-io/cronexpr/schedule.go:157.40,158.18 1 1
98+
github.com/gitploy-io/cronexpr/schedule.go:163.3,165.23 2 1
99+
github.com/gitploy-io/cronexpr/schedule.go:158.18,161.4 2 1
100+
github.com/gitploy-io/cronexpr/schedule.go:165.23,166.10 1 1
101+
github.com/gitploy-io/cronexpr/schedule.go:175.48,180.50 2 1
102+
github.com/gitploy-io/cronexpr/schedule.go:183.2,183.29 1 0
103+
github.com/gitploy-io/cronexpr/schedule.go:180.50,182.3 1 1

parser.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,19 @@ func Parse(expr string) (*Schedule, error) {
8080
return nil, err
8181
}
8282

83-
if hour, err = parseField(fields[1], boundMinute, translater{}); err != nil {
83+
if hour, err = parseField(fields[1], boundHour, translater{}); err != nil {
8484
return nil, err
8585
}
8686

87-
if dom, err = parseField(fields[2], boundMinute, translater{}); err != nil {
87+
if dom, err = parseField(fields[2], boundDOM, translater{}); err != nil {
8888
return nil, err
8989
}
9090

91-
if month, err = parseField(fields[3], boundMinute, translaterMonth); err != nil {
91+
if month, err = parseField(fields[3], boundMonth, translaterMonth); err != nil {
9292
return nil, err
9393
}
9494

95-
if dow, err = parseField(fields[4], boundMinute, translaterDay); err != nil {
95+
if dow, err = parseField(fields[4], boundDOW, translaterDay); err != nil {
9696
return nil, err
9797
}
9898

0 commit comments

Comments
 (0)