diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 1636a6a..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: 2.1 - -executors: - golangci-lint: - docker: - - image: golangci/golangci-lint:v1.25.0 - go: - docker: - - image: vansante/go-ffprobe:latest - -jobs: - lint: - executor: golangci-lint - steps: - - checkout - - run: golangci-lint run - - test: - executor: go - steps: - - checkout - - run: go get github.com/jstemmer/go-junit-report - - run: mkdir -p /tmp/test-results - - run: go test -v -race ./... | go-junit-report > /tmp/test-results/spec.xml - - store_test_results: - path: /tmp/test-results - -workflows: - version: 2 - main: - jobs: - - lint - - test \ No newline at end of file diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml new file mode 100644 index 0000000..e98c5de --- /dev/null +++ b/.github/workflows/golangci-lint.yaml @@ -0,0 +1,19 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - master + - main + - v2 + pull_request: + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..19df63c --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,25 @@ +on: [push, pull_request] +name: Test +jobs: + test: + strategy: + matrix: + go-version: [1.15.x, 1.16.x, 1.17.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Install Linux packages + if: matrix.os == 'ubuntu-latest' + run: sudo apt update && sudo apt install -y --no-install-recommends ffmpeg + + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + run: go test -v ./... diff --git a/.golangci.yml b/.golangci.yml index 53eb4ae..5741d11 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -27,19 +27,21 @@ linters-settings: linters: enable: + - exportloopref - megacheck - govet - - golint - gosec - unconvert - goconst - gocyclo - gofmt - - maligned - lll + - revive - unparam - nakedret - misspell + disable: + - exhaustive enable-all: false disable-all: false presets: diff --git a/probedata.go b/probedata.go index 66fd485..6116484 100644 --- a/probedata.go +++ b/probedata.go @@ -179,4 +179,4 @@ func (p *ProbeData) firstStream(streamType StreamType) *Stream { } } return nil -} \ No newline at end of file +}