Skip to content

Commit

Permalink
Merge pull request #7 from argoproj-labs/add-CI
Browse files Browse the repository at this point in the history
added CI
  • Loading branch information
wilkermichael authored Feb 6, 2024
2 parents 6c6dcc8 + f9cacf8 commit 1d7e021
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod"
target-branch: main
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
labels:
- area/dependency
ignore:
- dependency-name: k8s.io/*

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Consul plugin CI
on: [push]

env:
GOLANG_VERSION: '1.21'

jobs:
unit-tests:
name: Unit tests running
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}

- name: Checkout code
uses: actions/checkout@v4

- name: Unit tests running
run: |
go test -v ./...
linting:
name: Go code linting
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}

- name: Checkout code
uses: actions/checkout@v4

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --verbose --timeout 6m

build:
name: Build creation
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}

- name: Checkout code
uses: actions/checkout@v4

- name: Build creation
run: |
make build
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go_lint:

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=$(TARGETARCH) go build -o rollouts-plugin-trafficrouter-consul ./
CGO_ENABLED=0 GOOS=linux GOARCH=$(TARGETARCH) go build -v -o rollouts-plugin-trafficrouter-consul ./

docker:
docker build . -t rollouts-plugin-trafficrouter-consul
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (r *RpcPlugin) updateResolverForAbortedRollout(canarySubsetName string, sr

func (r *RpcPlugin) updateResolverSubsetForRollouts(subsetName, filterValue string, sr *consulv1aplha1.ServiceResolver) (*consulv1aplha1.ServiceResolver, error) {
if _, ok := sr.Spec.Subsets[subsetName]; !ok {
return nil, errors.New(fmt.Sprintf("spec.subsets.%s.filter was not found in consul service resolver: %v", subsetName, sr))
return nil, fmt.Errorf("spec.subsets.%s.filter was not found in consul service resolver: %v", subsetName, sr)
}
subset := sr.Spec.Subsets[subsetName]
subset.Filter = filterValue
Expand Down

0 comments on commit 1d7e021

Please sign in to comment.