From de6fac66b248e1bd7f78decab2719cb9daf3a496 Mon Sep 17 00:00:00 2001 From: Renat Mennanov Date: Mon, 6 Feb 2023 12:56:17 -0800 Subject: [PATCH] Migrate from Drone to Github Actions. --- .drone.yml | 103 --------------------------------- .github/workflows/coverage.yml | 21 +++++++ .github/workflows/linter.yml | 17 ++++++ .github/workflows/tests.yml | 20 +++++++ .gitignore | 3 +- 5 files changed, 60 insertions(+), 104 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/linter.yml create mode 100644 .github/workflows/tests.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 0737078..0000000 --- a/.drone.yml +++ /dev/null @@ -1,103 +0,0 @@ -kind: pipeline -name: go1.19 -type: docker - -steps: - - name: test - image: golang:1.19 - commands: - - go vet ./... - - go test -v -coverprofile=coverage.txt -covermode=atomic ./... - - - name: coverage - image: plugins/codecov - settings: - token: - from_secret: codecov-token - files: - - coverage.txt - ---- -kind: pipeline -name: go1.18 -type: docker - -steps: - - name: test - image: golang:1.18 - commands: - - go vet ./... - - go test ./... - ---- -kind: pipeline -name: go1.17 -type: docker - -steps: - - name: test - image: golang:1.17 - commands: - - go vet ./... - - go test ./... - ---- -kind: pipeline -name: go1.16 -type: docker - -steps: - - name: test - image: golang:1.16 - commands: - - go vet ./... - - go test ./... - ---- -kind: pipeline -name: go1.15 -type: docker - -steps: - - name: test - image: golang:1.15 - commands: - - go vet ./... - - go test ./... - ---- -kind: pipeline -name: go1.14 -type: docker - -steps: - - name: test - image: golang:1.14 - commands: - - go vet ./... - - go test ./... - ---- -kind: pipeline -name: go1.13 -type: docker - -steps: - - name: test - image: golang:1.13 - commands: - - go vet ./... - - go test ./... - ---- -kind: pipeline -name: lint -type: docker - -steps: - - name: lint - image: golang:1.19 - commands: - - go get -d github.com/mgechev/revive - - go install github.com/mgechev/revive - - revive -formatter=friendly -config=revive.toml ./... diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..762ea9f --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,21 @@ +name: Tests coverage + +on: [ "push", "pull_request" ] + +jobs: + + build: + name: Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Go 1.20 + uses: actions/setup-go@v3 + with: + go-version: '1.20' + - name: Run tests with coverage + run: go test -v -coverprofile=coverage.txt -covermode=atomic ./... + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..0e4a9a0 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,17 @@ +name: Linter + +on: [ "push", "pull_request" ] + +jobs: + + build: + name: Linter + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Go 1.20 + uses: actions/setup-go@v3 + with: + go-version: '1.20' + - name: Go vet + run: go vet ./... diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..37ca7d4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,20 @@ +name: Go tests + +on: [ push, pull_request ] + +jobs: + go-test: + + runs-on: ubuntu-latest + strategy: + matrix: + go-version: [ '1.14', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20' ] + + steps: + - uses: actions/checkout@v3 + - name: Setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + - name: Run tests + run: go test -v ./... \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2b91dc4..f06cda0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ vendor/ -coverage.* +coverage.out +coverage.txt