Skip to content

Commit

Permalink
chore: improve actions
Browse files Browse the repository at this point in the history
  • Loading branch information
erayarslan committed Dec 13, 2023
1 parent 0d62dad commit 2a7c862
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 235 deletions.
238 changes: 7 additions & 231 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ name: Build

on:
push:
branches:
- 'master'
- '!gh-pages'
branches: [master]
pull_request:
branches:
- 'master'
branches: [master]

jobs:
build:
Expand All @@ -23,11 +20,10 @@ jobs:
with:
go-version: '1.20'

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
args: -c .golangci.yml --timeout=5m -v
- name: Lint
run: |
make init
make lint
- name: Install dependencies
run: go get .
Expand All @@ -36,224 +32,4 @@ jobs:
run: go build -v ./...

- name: Test
run: go test -parallel 1 -v ./...
dcp_test_v501:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 5.0.1
dcp_test_v510:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 5.1.0
dcp_test_v550:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 5.5.0
dcp_test_v600:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 6.0.0
dcp_test_v650:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 6.5.0
dcp_test_v660:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 6.6.0
dcp_test_v700:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 7.0.0
dcp_test_v710:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 7.1.0
dcp_test_v720:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 7.2.0
dcp_test_v723:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: 7.2.3
run: go test -parallel 1 -v ./...
32 changes: 32 additions & 0 deletions .github/workflows/dcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: DCP

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
dcp:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ "5.0.1", "5.1.0", "5.5.0", "6.0.0", "6.5.0", "6.6.0", "7.0.0", "7.1.0", "7.2.0", "7.2.3" ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
run: go get .

- name: Test DCP
run: go test -run "^\QTestDcp\E$"
env:
CB_VERSION: ${{ matrix.version }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: IntegrationTest
name: Integration

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
branches: [master]

jobs:
test:
integration:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '*'

jobs:
goreleaser:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
default: init

init:
go mod download
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/[email protected]

Expand All @@ -14,6 +13,9 @@ linter:
fieldalignment -fix ./...
golangci-lint run -c .golangci.yml --timeout=5m -v --fix

lint:
golangci-lint run -c .golangci.yml --timeout=5m -v

test:
go test ./... -bench .

Expand Down

0 comments on commit 2a7c862

Please sign in to comment.