Skip to content

Commit 2578220

Browse files
committed
refactors to simple cli
1 parent 07e5cf2 commit 2578220

File tree

685 files changed

+130201
-979145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

685 files changed

+130201
-979145
lines changed

.github/workflows/import.yaml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/on-push-test.yaml renamed to .github/workflows/on-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
contents: read
1818
security-events: write
1919
with:
20-
go-version: ^1.20.1
20+
go-version: ^1.20.2
2121
scan-severity: 'CRITICAL,HIGH,MEDIUM'

.github/workflows/on-tag-img.yaml

Lines changed: 0 additions & 127 deletions
This file was deleted.
File renamed without changes.

.github/workflows/test.yaml

Lines changed: 83 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,60 @@ on:
66
description: 'Go version to use'
77
required: false
88
type: string
9-
default: ^1.20.1
9+
default: ^1.20.2
1010
scan-severity:
1111
description: 'Trivy scan severity'
1212
required: false
1313
type: string
1414
default: 'CRITICAL,HIGH'
15+
golangci_version:
16+
description: 'golangci version to use'
17+
required: false
18+
type: string
19+
default: 'v1.51'
1520
permissions:
1621
contents: read
1722
jobs:
18-
test:
23+
24+
unit:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
security-events: write
28+
steps:
29+
- name: Setup Go
30+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
31+
with:
32+
go-version: ${{ inputs.go-version }}
33+
- run: go version
34+
- name: Cache Go Modules
35+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
36+
with:
37+
path: |
38+
~/go/pkg/mod
39+
~/.cache/go-build
40+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
41+
restore-keys: |
42+
${{ runner.os }}-go-
43+
- name: Checkout Code
44+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
45+
- name: Tidy Modules
46+
run: |
47+
make tidy
48+
- name: Unit Test
49+
run: |
50+
make test
51+
- name: Parse Coverage
52+
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
53+
with:
54+
flags: unittests # optional
55+
56+
lint:
1957
runs-on: ubuntu-latest
2058
permissions:
2159
security-events: write
2260
steps:
2361
- name: Setup Go
24-
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
62+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
2563
with:
2664
go-version: ${{ inputs.go-version }}
2765
- run: go version
@@ -35,7 +73,7 @@ jobs:
3573
restore-keys: |
3674
${{ runner.os }}-go-
3775
- name: Checkout Code
38-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
76+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
3977
- name: Tidy Modules
4078
run: |
4179
make tidy
@@ -48,7 +86,7 @@ jobs:
4886
if: steps.golangci_config.outputs.files_exists == 'true'
4987
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
5088
with:
51-
version: latest
89+
version: ${{ inputs.golangci_version }}
5290
- name: Config YAML Lint
5391
id: yamllint_config
5492
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2.0
@@ -59,6 +97,45 @@ jobs:
5997
uses: karancode/yamllint-github-action@fdef6bc189425ecc84cc4543b2674566c0827053 # master
6098
with:
6199
yamllint_config_filepath: .yamllint
100+
101+
e2e:
102+
runs-on: ubuntu-latest
103+
permissions:
104+
security-events: write
105+
steps:
106+
- name: Setup Go
107+
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
108+
with:
109+
go-version: ${{ inputs.go-version }}
110+
- run: go version
111+
- name: Cache Go Modules
112+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
113+
with:
114+
path: |
115+
~/go/pkg/mod
116+
~/.cache/go-build
117+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
118+
restore-keys: |
119+
${{ runner.os }}-go-
120+
- name: Checkout Code
121+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
122+
- name: Tidy Modules
123+
run: |
124+
make tidy
125+
- name: Build Binary
126+
run: |-
127+
make build
128+
- name: Run Integration Tests
129+
run: |-
130+
tools/e2e
131+
132+
scan:
133+
runs-on: ubuntu-latest
134+
permissions:
135+
security-events: write
136+
steps:
137+
- name: Checkout Code
138+
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
62139
- name: Scan Repo
63140
uses: aquasecurity/trivy-action@1f0aa582c8c8f5f7639610d6d38baddfea4fdcee # master
64141
with:
@@ -69,17 +146,7 @@ jobs:
69146
output: 'trivy-results.sarif'
70147
severity: ${{ inputs.scan-severity }}
71148
exit-code: '1'
72-
- name: Unit Test
73-
run: |
74-
make test
75-
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
76-
with:
77-
flags: unittests # optional
78149
- name: Upload Report
79150
uses: github/codeql-action/upload-sarif@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.11.6
80151
with:
81-
sarif_file: 'trivy-results.sarif'
82-
- name: Run Integration Tests
83-
run: |-
84-
make build
85-
tools/e2e
152+
sarif_file: 'trivy-results.sarif'

Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)