{"id":208056,"date":"2025-07-08T13:41:55","date_gmt":"2025-07-08T05:41:55","guid":{"rendered":"https:\/\/server.hk\/cnblog\/208056\/"},"modified":"2025-07-08T13:41:55","modified_gmt":"2025-07-08T05:41:55","slug":"github-actions-%e5%9c%a8%e6%9c%ac%e5%9c%b0%e4%b8%bb%e6%9c%ba%e4%b8%8a%e7%9b%91%e5%90%ac","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/208056\/","title":{"rendered":"Github Actions \u5728\u672c\u5730\u4e3b\u673a\u4e0a\u76d1\u542c"},"content":{"rendered":"<p><b><\/b> <\/p>\n<p>\u5f53\u524d\u4f4d\u7f6e\uff1a <span>&gt;<\/span> <span>&gt;<\/span> <span>&gt;<\/span> <span>&gt;<\/span> <span>Github Actions \u5728\u672c\u5730\u4e3b\u673a\u4e0a\u76d1\u542c<\/span><\/p>\n<p><span>\u6765\u6e90\uff1astackoverflow<\/span><br \/>\n<span>2024-04-28 12:21:29<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u54c8\u55bd\uff01\u4eca\u5929\u5fc3\u8840\u6765\u6f6e\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aGithub Actions \u5728\u672c\u5730\u4e3b\u673a\u4e0a\u76d1\u542c\u300b<\/span>\uff0c\u60f3\u5fc5\u5927\u5bb6\u5e94\u8be5\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\u90fd\u4e0d\u964c\u751f\u5427\uff0c\u90a3\u4e48\u9605\u8bfb\u672c\u6587\u5c31\u90fd\u4e0d\u4f1a\u5f88\u56f0\u96be\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">Golang<\/span>\uff0c\u5343\u4e07\u522b\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u4f60\uff01<\/p>\n<p> \u95ee\u9898\u5185\u5bb9<br \/>\n <\/p>\n<p>\u6211\u6b63\u5728\u5c1d\u8bd5\u4e3a\u6211\u7684 go \u9879\u76ee\u8bbe\u7f6e\u81ea\u52a8\u6d4b\u8bd5\u8986\u76d6\u7387\u5206\u6790\uff0c\u4f46\u662f\u6211\u65e0\u6cd5\u8ba9\u5b83\u5728 github \u64cd\u4f5c\u4e0a\u8fd0\u884c\uff0c\u56e0\u4e3a go test \u547d\u4ee4\u56e0\u4ee5\u4e0b\u9519\u8bef\u800c\u5931\u8d25\uff1a<\/p>\n<pre>run go test -race -coverprofile=coverage.txt -covermode=atomic .\/...\ngo: downloading github.com\/alyu\/configparser v0.0.0-20191103060215-744e9a66e7bc\ngo: downloading gorm.io\/driver\/mysql v1.1.2\ngo: downloading gorm.io\/driver\/postgres v1.1.1\ngo: downloading gorm.io\/driver\/sqlite v1.1.5\ngo: downloading gorm.io\/gorm v1.21.15\ngo: downloading gopkg.in\/guregu\/null.v4 v4.0.0\ngo: downloading github.com\/gorilla\/mux v1.8.0\ngo: downloading github.com\/go-sql-driver\/mysql v1.6.0\ngo: downloading github.com\/jackc\/pgx\/v4 v4.13.0\ngo: downloading github.com\/mattn\/go-sqlite3 v1.14.8\ngo: downloading github.com\/jinzhu\/inflection v1.0.0\ngo: downloading github.com\/jinzhu\/now v1.1.2\ngo: downloading github.com\/jackc\/pgconn v1.10.0\ngo: downloading github.com\/jackc\/pgio v1.0.0\ngo: downloading github.com\/jackc\/pgproto3\/v2 v2.1.1\ngo: downloading github.com\/jackc\/pgtype v1.8.1\ngo: downloading github.com\/jackc\/chunkreader\/v2 v2.0.1\ngo: downloading github.com\/jackc\/pgpassfile v1.0.0\ngo: downloading github.com\/jackc\/pgservicefile v0.0.0-20200714003250-2b9c44734f2b\ngo: downloading golang.org\/x\/crypto v0.0.0-20210817164053-32db794688a5\ngo: downloading golang.org\/x\/text v0.3.7\n?       github.com\/zaprit\/reflow    [no test files]\n?       github.com\/zaprit\/reflow\/config [no test files]\n?       github.com\/zaprit\/reflow\/database   [no test files]\n?       github.com\/zaprit\/reflow\/internal   [no test files]\n?       github.com\/zaprit\/reflow\/models [no test files]\n2021\/10\/24 21:59:38 get \"http:\/\/127.0.0.1:8069\/api\": dial tcp 127.0.0.1:8069: connect: connection refused\nfail    github.com\/zaprit\/reflow\/technicapi 0.049s\n?       github.com\/zaprit\/reflow\/utils  [no test files]\nfail\nerror: process completed with exit code 1.<\/pre>\n<p>\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u5df2\u7ecf\u5c1d\u8bd5\u5f3a\u5236\u6d4b\u8bd5\u5728 <code>127.0.0.1<\/code> \u4e0a\u4fa6\u542c\uff0c\u56e0\u4e3a\u6211\u8ba4\u4e3a\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e github \u670d\u52a1\u5668\u4e0a\u7f3a\u4e4f ipv6 \u652f\u6301\u9020\u6210\u7684\uff0c\u5c3d\u7ba1\u8fd9\u4e0d\u8d77\u4f5c\u7528\u3002<\/p>\n<p>\u8fd9\u662f\u6211\u7528\u4e8e\u6d4b\u8bd5\u7684 ci \u7ba1\u9053<\/p>\n<pre># This lints the Reflow project\n\nname: Lint\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    branches: [ master ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\/checkout@v2\n\n      - name: Setup Go environment\n        uses: actions\/[email&nbsp;protected]\n        with:\n          go-version: 1.17.1\n          stable: true\n          token: ${{ github.token }}\n      - name: Run golangci-lint\n        uses: golangci\/[email&nbsp;protected]\n<\/pre>\n<p> <\/p>\n<h2>\u6b63\u786e\u7b54\u6848<\/h2>\n<p> <\/p>\n<p>\u6211\u4fee\u590d\u4e86\u5b83\uff0c\u6211\u731c\u8fd9\u662f\u7aef\u53e3\u7684\u6743\u9650\u95ee\u9898\uff0c\u56e0\u4e3a\u6211\u5207\u6362\u5230\u4f7f\u7528 net\/http\/httptest \u4f5c\u4e3a\u670d\u52a1\u5668\u5e76\u4e14\u5b83\u6709\u6548\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\uff01\u66f4\u591a\u5173\u4e8eGolang\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u516c\u4f17\u53f7\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u4f4d\u7f6e\uff1a &gt; &gt; &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-208056","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/208056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=208056"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/208056\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=208056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=208056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=208056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}