@@ -31,12 +31,13 @@ jobs:
31
31
32
32
- name : Check for changes
33
33
run : |
34
- # Check if any untracked files exist
34
+ # Check if any newly added docs exist
35
35
untracked_files=$(git ls-files --others --exclude-standard)
36
36
37
37
# If there are untracked files, fail the workflow
38
38
if [ -n "$untracked_files" ]; then
39
- echo "Untracked files found:"
39
+ echo "New Untracked files found"
40
+ echo "please check if docs were added for new commands"
40
41
echo "$untracked_files"
41
42
exit 1 # This will fail the workflow
42
43
else
@@ -49,14 +50,25 @@ jobs:
49
50
with :
50
51
version : ${{ steps.dagger_version.outputs.version }}
51
52
verb : call
52
- args : lint-report export --path=golangci-lint-report.sarif
53
+ args : lint-report export --path=golangci-lint.report
53
54
54
- - uses : reviewdog/action-setup@v1
55
- - name : Run Reviewdog
56
- env :
57
- REVIEWDOG_GITHUB_API_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55
+ - name : Generate lint summary
58
56
run : |
59
- reviewdog -f=sarif -name="Golang Linter Report" -reporter=github-check -filter-mode nofilter -fail-level any -tee < golangci-lint-report.sarif
57
+ echo "<h2> 📝 Lint results</h2>" >> $GITHUB_STEP_SUMMARY
58
+ cat golangci-lint.report >> $GITHUB_STEP_SUMMARY
59
+ # Check if the lint report contains any content (error or issues)
60
+ if [ -s golangci-lint.report ]; then
61
+ # If the file contains content, output an error message and exit with code 1
62
+ echo "⚠️ Linting issues found!" >> $GITHUB_STEP_SUMMARY
63
+ exit 1
64
+ fi
65
+
66
+ # - uses: reviewdog/action-setup@v1
67
+ # - name: Run Reviewdog
68
+ # env:
69
+ # REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70
+ # run: |
71
+ # reviewdog -f=sarif -name="Golang Linter Report" -reporter=github-check -filter-mode nofilter -fail-level any -tee < golangci-lint-report.sarif
60
72
61
73
test-code :
62
74
runs-on : ubuntu-latest
71
83
with :
72
84
version : ${{ steps.dagger_version.outputs.version }}
73
85
verb : call
74
- args : test
86
+ args : test-report export --path=TestReport.json
87
+
88
+ - name : Summarize Tests
89
+
90
+ with :
91
+ fromJSONFile : TestReport.json
75
92
76
93
- name : Build Binary
77
94
uses : dagger/dagger-for-github@v7
@@ -81,67 +98,85 @@ jobs:
81
98
args : build-dev --platform linux/amd64 export --path=./harbor-dev
82
99
83
100
push-latest-images :
84
- - name : Print GitHub ref for debugging
85
- run : echo "GitHub ref: $GITHUB_REF"
86
-
87
- - name : Push images
88
- if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
89
- needs :
90
- - lint
91
- - test-code
92
- permissions :
93
- contents : read
94
- id-token : write
95
- runs-on : ubuntu-latest
96
- steps :
97
- - name : Checkout repo
98
- uses : actions/checkout@v4
99
- with :
100
- fetch-depth : 0
101
-
102
- - name : Publish and Sign Snapshot Image
103
- uses : ./.github/actions/publish-and-sign
104
- with :
105
- IMAGE_TAGS : latest
106
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
107
- REGISTRY_PASSWORD : ${{ secrets.REGISTRY_PASSWORD }}
108
- REGISTRY_ADDRESS : ${{ vars.REGISTRY_ADDRESS }}
109
- REGISTRY_USERNAME : ${{ vars.REGISTRY_USERNAME }}
101
+ needs :
102
+ - lint
103
+ - test-code
104
+ permissions :
105
+ contents : read
106
+ id-token : write
107
+ runs-on : ubuntu-latest
108
+ steps :
109
+ - name : Print GitHub ref for debugging
110
+ run : |
111
+ echo "GitHub ref: $GITHUB_REF"
112
+
113
+ - name : Push images
114
+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
115
+ run : |
116
+ echo "Pushing images..."
117
+
118
+ - name : Checkout repo
119
+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
120
+ uses : actions/checkout@v4
121
+ with :
122
+ fetch-depth : 0
123
+
124
+ - name : Publish and Sign Snapshot Image
125
+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
126
+ uses : ./.github/actions/publish-and-sign
127
+ with :
128
+ IMAGE_TAGS : latest
129
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
130
+ REGISTRY_PASSWORD : ${{ secrets.REGISTRY_PASSWORD }}
131
+ REGISTRY_ADDRESS : ${{ vars.REGISTRY_ADDRESS }}
132
+ REGISTRY_USERNAME : ${{ vars.REGISTRY_USERNAME }}
110
133
111
134
publish-release :
112
- - name : Print GitHub ref for debugging
113
- run : echo "GitHub ref: $GITHUB_REF"
114
-
115
- - name : Push images
116
- if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
117
- needs :
118
- - lint
119
- - test-code
120
- permissions :
121
- contents : write
122
- packages : write
123
- id-token : write
124
- runs-on : ubuntu-latest
125
- steps :
126
- - name : Checkout repo
127
- uses : actions/checkout@v4
128
- with :
129
- fetch-depth : 0
130
- - name : Create Release
131
- uses : dagger/dagger-for-github@v7
132
- env :
133
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
134
- with :
135
- version : " latest"
136
- verb : call
137
- args : " release --github-token=env:GITHUB_TOKEN"
138
-
139
- - name : Publish and Sign Tagged Image
140
- if : success()
141
- uses : ./.github/actions/publish-and-sign
142
- with :
143
- IMAGE_TAGS : " latest, ${{ github.ref_name }}"
144
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
145
- REGISTRY_PASSWORD : ${{ secrets.REGISTRY_PASSWORD }}
146
- REGISTRY_ADDRESS : ${{ vars.REGISTRY_ADDRESS }}
147
- REGISTRY_USERNAME : ${{ vars.REGISTRY_USERNAME }}
135
+ needs :
136
+ - lint
137
+ - test-code
138
+ permissions :
139
+ contents : write
140
+ packages : write
141
+ id-token : write
142
+ runs-on : ubuntu-latest
143
+ steps :
144
+ - name : Print GitHub ref for debugging
145
+ run : |
146
+ echo "GitHub ref: $GITHUB_REF"
147
+
148
+ - name : Push images
149
+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
150
+ uses : ./.github/actions/publish-and-sign
151
+ with :
152
+ IMAGE_TAGS : latest, ${{ github.ref_name }}
153
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
154
+ REGISTRY_PASSWORD : ${{ secrets.REGISTRY_PASSWORD }}
155
+ REGISTRY_ADDRESS : ${{ vars.REGISTRY_ADDRESS }}
156
+ REGISTRY_USERNAME : ${{ vars.REGISTRY_USERNAME }}
157
+
158
+ - name : Checkout repo
159
+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
160
+ uses : actions/checkout@v4
161
+ with :
162
+ fetch-depth : 0
163
+
164
+ - name : Create Release
165
+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
166
+ uses : dagger/dagger-for-github@v7
167
+ env :
168
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
169
+ with :
170
+ version : " latest"
171
+ verb : call
172
+ args : " release --github-token=env:GITHUB_TOKEN"
173
+
174
+ - name : Publish and Sign Tagged Image
175
+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
176
+ uses : ./.github/actions/publish-and-sign
177
+ with :
178
+ IMAGE_TAGS : " latest, ${{ github.ref_name }}"
179
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
180
+ REGISTRY_PASSWORD : ${{ secrets.REGISTRY_PASSWORD }}
181
+ REGISTRY_ADDRESS : ${{ vars.REGISTRY_ADDRESS }}
182
+ REGISTRY_USERNAME : ${{ vars.REGISTRY_USERNAME }}
0 commit comments