File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,23 @@ jobs:
1414 build :
1515 name : Build & Test
1616 runs-on : ubuntu-latest
17+
18+ # Set GOPRIVATE to prevent fetching internal packages externally
1719 env :
1820 GOPRIVATE : github.com/co-browser/agent-browser
21+
1922 steps :
2023 - name : Check out code
2124 uses : actions/checkout@v4
25+ with :
26+ fetch-depth : 1 # Shallow clone for faster checkout
2227
2328 - name : Set up Go
2429 uses : actions/setup-go@v5
2530 with :
2631 go-version : ' 1.24'
32+ check-latest : true
33+ cache : true # Enable Go module cache
2734
2835 - name : Setup tools
2936 run : make setup
3441 - name : Check formatting
3542 run : |
3643 make fmt
37- # Check if git status is clean after formatting
38- if ! git diff --exit-code ; then
44+ FORMAT_DIFF=$( git diff)
45+ if [ -n "$FORMAT_DIFF" ] ; then
3946 echo "Code is not formatted correctly. Run 'make fmt' locally."
47+ echo "The following files need formatting:"
48+ git diff --name-only
4049 exit 1
4150 fi
4251
4554
4655 - name : Run tests
4756 run : make test
57+ # Show test coverage if any tests exist
58+ if : success()
59+ continue-on-error : true
4860
4961 - name : Build application
50- run : make build
62+ run : make build
63+
64+ - name : Archive build artifacts
65+ if : success()
66+ uses : actions/upload-artifact@v4
67+ with :
68+ name : agent-browser-binary
69+ path : out/agent-browser
70+ retention-days : 7
Original file line number Diff line number Diff line change 5050
5151tidy :
5252 @echo " Tidying modules..."
53- @go mod tidy
53+ @GOPRIVATE=github.com/co-browser/agent-browser go mod tidy
5454
5555lint :
5656 @echo " Linting code... (requires golangci-lint)"
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ func NewServer(mux *http.ServeMux) *http.Server {
3333// Renamed to be exported.
3434func RegisterWebServerHooks (lifecycle fx.Lifecycle , server * http.Server , logger log.Logger ) {
3535 lifecycle .Append (fx.Hook {
36- OnStart : func (ctx context.Context ) error {
36+ OnStart : func (_ context.Context ) error {
3737 go func () {
3838 logger .Info ().Str ("addr" , server .Addr ).Msg ("Starting HTTP server" )
3939 if err := server .ListenAndServe (); err != nil && ! errors .Is (err , http .ErrServerClosed ) {
You can’t perform that action at this time.
0 commit comments