Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade #12

Merged
merged 6 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build
on:
push:
branches:
- main
pull_request:
jobs:
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
test:
name: go test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@v2
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-test-${{ hashFiles('**/go.sum') }}
restore-keys: go-test-
- name: Run go test
run: |
set -euo pipefail
go generate
go test -coverprofile /tmp/coverage.out -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
echo "# Code coverage summary" > /tmp/coverage.md
echo "|File|Type|Coverage|" >> /tmp/coverage.md
echo "|----|----|--------|" >> /tmp/coverage.md
go tool cover -func /tmp/coverage.out | sed -e 's/\s\s*/|/g' -e 's/^/|/g' -e 's/$/|/g' >> /tmp/coverage.md

cat /tmp/coverage.md >> $GITHUB_STEP_SUMMARY
echo "::group::Code coverage summary"
go tool cover -func /tmp/coverage.out
echo "::endgroup::"
- name: Upload test log
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: |
/tmp/gotest.log
/tmp/coverage.out
/tmp/coverage.md
if-no-files-found: error
26 changes: 14 additions & 12 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,20 @@ linters:
# endregion
linters-settings:
depguard:
list-type: whitelist
include-go-root: false
packages:
- go.flow.arcalot.io/
- go.arcalot.io/
- github.com/docker/
- github.com/opencontainers/
- gopkg.in/yaml.v3
- github.com/fxamacker/cbor
- k8s.io/
- sigs.k8s.io/
- golang.org/
rules:
main:
list-mode: strict
allow:
- $gostd
- go.flow.arcalot.io/
- go.arcalot.io/
- github.com/docker/
- github.com/opencontainers/
- gopkg.in/yaml.v3
- github.com/fxamacker/cbor
- k8s.io/
- sigs.k8s.io/
- golang.org/
govet:
enable-all: true
check-shadowing: false
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module go.flow.arcalot.io/deployer

go 1.18
go 1.21

require (
go.arcalot.io/assert v1.6.0
go.arcalot.io/lang v1.0.0
go.arcalot.io/log/v2 v2.0.0
go.flow.arcalot.io/pluginsdk v0.5.1
go.arcalot.io/assert v1.7.0
go.arcalot.io/lang v1.1.0
go.arcalot.io/log/v2 v2.1.0
go.flow.arcalot.io/pluginsdk v0.8.0
)
19 changes: 9 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
go.arcalot.io/assert v1.6.0 h1:iKA8SZZ1MRblMX5QAwwY5RbpR+VNyp//4IU7vo08Xu0=
go.arcalot.io/assert v1.6.0/go.mod h1:Xy3ScX0p9IMY89gdsgexOKxnmDr0nGHG9dV7p8Uxg7w=
go.arcalot.io/lang v1.0.0 h1:mgDaieT4wWdZTnR4V7+/pgYRmzfU7VZZgIzHccuxAbY=
go.arcalot.io/lang v1.0.0/go.mod h1:ALqfYEhAzC2WoGLaycmJoNJd5NmkR7V1PSKp/c5D278=
go.arcalot.io/log/v2 v2.0.0 h1:mbmsWDVBXZNWrDzUh5JLzeGCQ59kTuMFs+pyfJGc1hk=
go.arcalot.io/log/v2 v2.0.0/go.mod h1:1V8jnFIIGwh2CtcGkHNOmy1nCo7LbazQNkUcnKYNMn4=
go.flow.arcalot.io/pluginsdk v0.5.0 h1:TRS/waCTcdoMZ9neDAcfy3zpzyDnPHRbhV+Y1kpcw3Y=
go.flow.arcalot.io/pluginsdk v0.5.0/go.mod h1:2s2f//7uOkBjr1QaiWJD/bqDIeLlINJtD1BhiY4aGPM=
go.flow.arcalot.io/pluginsdk v0.5.1 h1:ebb2ThAqmjmwGpDyKpd1wEDUisPqPabgARjFohy47Io=
go.flow.arcalot.io/pluginsdk v0.5.1/go.mod h1:2s2f//7uOkBjr1QaiWJD/bqDIeLlINJtD1BhiY4aGPM=
go.arcalot.io/assert v1.7.0 h1:PTLyeisNMUKpM9wXRDxResanBhuGOYO1xFK3v5b3FSw=
go.arcalot.io/assert v1.7.0/go.mod h1:nNmWPoNUHFyrPkNrD2aASm5yPuAfiWdB/4X7Lw3ykHk=
go.arcalot.io/lang v1.1.0 h1:ugglRKpd3qIMkdghAjKJxsziIgHm8QpxrzZPSXoa08I=
go.arcalot.io/lang v1.1.0/go.mod h1:2BZJO4csY7NnN/Nf1+eTdIQH4A2vxtOMneaO+PJl+Co=
go.arcalot.io/log/v2 v2.1.0 h1:lNO931hJ82LgS6WcCFCxpLWXQXPFhOkz6PyAJ/augq4=
go.arcalot.io/log/v2 v2.1.0/go.mod h1:PNWOSkkPmgS2OMlWTIlB/WqOw0yaBvDYd8ENAP80H4k=
go.flow.arcalot.io/pluginsdk v0.8.0 h1:cShsshrR17ZFLcbgi3aZvqexLttcp3JISFNqPUPuDvA=
go.flow.arcalot.io/pluginsdk v0.8.0/go.mod h1:sk7ssInR/T+Gy+RSRr+QhKqZcECFFxMyn1hPQCTZSyU=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 2 additions & 0 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"go.flow.arcalot.io/pluginsdk/schema"
)

// DeploymentType is the mechanism of deployment, such as
// image or python.
type DeploymentType string

// ConnectorFactory is an abstraction that hides away the complexity of instantiating a Connector. Its main purpose is
Expand Down
6 changes: 0 additions & 6 deletions registry/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ import (
type testConfig struct {
}

var testConfigInput = map[string]any{
"test-type": map[string]any{
"deployer_name": "test",
},
}

type testNewFactory struct {
}

Expand Down
2 changes: 2 additions & 0 deletions registry/new.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package registry provides an interface to an aggregate of deployers,
// and a factory for that aggregate.
package registry

import (
Expand Down
2 changes: 2 additions & 0 deletions registry/registry.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package registry provides an interface to an aggregate of deployers,
// and a factory for that aggregate.
package registry

import (
Expand Down
Loading