diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..571cf33 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + name: Go 1.25 on ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: "1.25.x" + + - name: Lint + if: matrix.os == 'ubuntu-latest' + run: | + if [ -n "$(gofmt -l .)" ]; then + echo "Go code is not formatted. Run 'gofmt -w .'" + exit 1 + fi + go vet ./... + + - name: Install + run: go install ./cmd/devd + + - name: Test + run: | + go test -v -race ./... + go run ./cmd/devd --help diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 07d9f98..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: go - -go: - - 1.12.x - -matrix: - include: - - os: linux - - os: windows - - os: osx - osx_image: xcode11 - -install: - - go get -t -v ./... - - go install ./cmd/devd - -script: - - go test -v -race ./... - -notifications: - email: - - aldo@corte.si diff --git a/fileserver/fileserver.go b/fileserver/fileserver.go index f188800..524504f 100644 --- a/fileserver/fileserver.go +++ b/fileserver/fileserver.go @@ -229,7 +229,7 @@ func localRedirect(w http.ResponseWriter, r *http.Request, newPath string) { // To use the operating system's file system implementation, // use http.Dir: // -// http.Handle("/", &fileserver.FileServer{Root: http.Dir("/tmp")}) +// http.Handle("/", &fileserver.FileServer{Root: http.Dir("/tmp")}) type FileServer struct { Version string Root http.FileSystem diff --git a/fileserver/z_last_test.go b/fileserver/z_last_test.go index 2ca2a93..ed5b0fc 100644 --- a/fileserver/z_last_test.go +++ b/fileserver/z_last_test.go @@ -46,12 +46,12 @@ func afterTest(t *testing.T) { } var bad string badSubstring := map[string]string{ - ").readLoop(": "a Transport", - ").writeLoop(": "a Transport", + ").readLoop(": "a Transport", + ").writeLoop(": "a Transport", "created by net/http/httptest.(*Server).Start": "an httptest.Server", - "timeoutHandler": "a TimeoutHandler", - "net.(*netFD).connect(": "a timing out dial", - ").noteClientGone(": "a closenotifier sender", + "timeoutHandler": "a TimeoutHandler", + "net.(*netFD).connect(": "a timing out dial", + ").noteClientGone(": "a closenotifier sender", } var stacks string for i := 0; i < 4; i++ {