From 05ae5805c8b981d258183e8c431644a5b21b8737 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Wed, 1 May 2024 17:47:17 +0100 Subject: [PATCH] Fix CI --- .editorconfig | 5 --- .github/workflows/test.yml | 70 ++++++++++++++------------------------ AUTHORS | 22 ------------ LICENSE | 2 +- example/main.go | 1 - fsevents.go | 21 ++++++------ fsevents_test.go | 1 - wrap.go | 1 - wrap_test.go | 1 - 9 files changed, 37 insertions(+), 87 deletions(-) delete mode 100644 .editorconfig delete mode 100644 AUTHORS diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index ba49e3c..0000000 --- a/.editorconfig +++ /dev/null @@ -1,5 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ccf8613..c90776c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,55 +1,37 @@ -name: test -on: [push] +name: 'test' +on: ['push', 'pull_request'] jobs: test: strategy: fail-fast: false matrix: - os: - - macos-10.15 - - macos-latest - go: - - '1.18.0-beta1' - - '1.17' - - '1.16' + os: ['macos-12', 'macos-latest'] + go: ['1.17', '1.22'] runs-on: ${{ matrix.os }} steps: - - name: setup Go - uses: actions/setup-go@v2 + - uses: 'actions/checkout@v4' + - uses: 'actions/setup-go@v5' with: - stable: 'false' - go-version: ${{ matrix.go }} + go-version: '${{ matrix.go }}' + - name: 'test' + run: 'go test --race ./...' - - name: checkout - uses: actions/checkout@v2 - - - name: test - run: | - go test --race ./... - - lint: - runs-on: macos-latest + staticcheck: + name: 'staticcheck' + runs-on: 'macos-latest' steps: - - name: setup Go - uses: actions/setup-go@v2 - with: - go-version: '1.17' - - - name: checkout - uses: actions/checkout@v2 - - - name: gofmt - run: | - test -z "$(gofmt -s -d . | tee /dev/stderr)" - - - name: vet - run: | - go vet ./... - - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - continue-on-error: true + - uses: 'actions/checkout@v4' + - uses: 'actions/setup-go@v5' with: - version: latest - skip-go-installation: true - + go-version: '1.22' + - uses: 'actions/cache@v4' + with: + key: '${{ runner.os }}-staticcheck' + path: | + ${{ runner.temp }}/staticcheck + ${{ steps.install_go.outputs.GOCACHE || '' }} + + - run: | + export STATICCHECK_CACHE="${{ runner.temp }}/staticcheck" + go install honnef.co/go/tools/cmd/staticcheck@latest + $(go env GOPATH)/bin/staticcheck ./... diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index e5d8d72..0000000 --- a/AUTHORS +++ /dev/null @@ -1,22 +0,0 @@ -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# You can update this list using the following command: -# -# $ git shortlog -se | awk '{print $2 " " $3 " " $4}' - -# Please keep the list sorted. - -Adrian Serrano -Andrew Metcalf -Drew Wells -Jeremy Jay -Koichi Shiraishi -Lachlan Donald -Matthias Kadenbach -Nathan Youngman -Sam Jacobson -Scott Albertson -Wade Simmons -alessandrozucca diff --git a/LICENSE b/LICENSE index cb53e5f..47a2bd9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014 The fsevents Authors. All rights reserved. +Copyright © The fsevents Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/example/main.go b/example/main.go index cf56c06..071678c 100644 --- a/example/main.go +++ b/example/main.go @@ -1,5 +1,4 @@ //go:build darwin -// +build darwin package main diff --git a/fsevents.go b/fsevents.go index b3430aa..72ea28c 100644 --- a/fsevents.go +++ b/fsevents.go @@ -1,5 +1,4 @@ //go:build darwin -// +build darwin // Package fsevents provides file system notifications on macOS. package fsevents @@ -16,7 +15,7 @@ type Event struct { // to its device's root. // Use DeviceForPath to determine the absolute path that's // being referred to. - Path string + Path string // Flags holds details what has happened. Flags EventFlags @@ -33,7 +32,7 @@ type Event struct { // and resume processing them later from a newly-created // EventStream, this is the value you would pass for the // EventStream.EventID along with Resume=true. - ID uint64 + ID uint64 } // DeviceForPath returns the device ID for the specified volume. @@ -49,10 +48,10 @@ func DeviceForPath(path string) (int32, error) { // You can provide your own event channel if you wish (or one will be // created on Start). // -// es := &EventStream{Paths: []string{"/tmp"}, Flags: 0} -// es.Start() -// es.Stop() -// ... +// es := &EventStream{Paths: []string{"/tmp"}, Flags: 0} +// es.Start() +// es.Stop() +// ... type EventStream struct { stream fsEventStreamRef rlref cfRunLoopRef @@ -62,19 +61,19 @@ type EventStream struct { // Events holds the channel on which events will be sent. // It's initialized by EventStream.Start if nil. - Events chan []Event + Events chan []Event // Paths holds the set of paths to watch, each // specifying the root of a filesystem hierarchy to be // watched for modifications. - Paths []string + Paths []string // Flags specifies what events to receive on the stream. - Flags CreateFlags + Flags CreateFlags // Resume specifies that watching should resume from the event // specified by EventID. - Resume bool + Resume bool // EventID holds the most recent event ID. // diff --git a/fsevents_test.go b/fsevents_test.go index 3f7bc6e..f5b3592 100644 --- a/fsevents_test.go +++ b/fsevents_test.go @@ -1,5 +1,4 @@ //go:build darwin -// +build darwin package fsevents diff --git a/wrap.go b/wrap.go index 29629a4..6b8fe60 100644 --- a/wrap.go +++ b/wrap.go @@ -1,5 +1,4 @@ //go:build darwin -// +build darwin package fsevents diff --git a/wrap_test.go b/wrap_test.go index 8c743aa..3ee78e3 100644 --- a/wrap_test.go +++ b/wrap_test.go @@ -1,5 +1,4 @@ //go:build darwin -// +build darwin package fsevents