Refactor import paths to use the full repository URL and remove obsolete GitHub Actions workflow file
This commit is contained in:
86
.drone.yml
Normal file
86
.drone.yml
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- pull_request
|
||||||
|
- push
|
||||||
|
- tag
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: lint
|
||||||
|
image: golangci/golangci-lint:v1.64.8-alpine
|
||||||
|
environment:
|
||||||
|
GOFLAGS: -mod=mod
|
||||||
|
commands:
|
||||||
|
- golangci-lint run --timeout=5m
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
image: golang:1.26
|
||||||
|
environment:
|
||||||
|
GOFLAGS: -mod=mod
|
||||||
|
commands:
|
||||||
|
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: golang:1.26
|
||||||
|
environment:
|
||||||
|
GOFLAGS: -mod=mod
|
||||||
|
commands:
|
||||||
|
- CGO_ENABLED=0 go build -v ./cmd/invertergui
|
||||||
|
|
||||||
|
- name: docker-build-validate
|
||||||
|
image: gcr.io/kaniko-project/executor:v1.23.2-debug
|
||||||
|
commands:
|
||||||
|
- /kaniko/executor --context "${DRONE_WORKSPACE}" --dockerfile "${DRONE_WORKSPACE}/Dockerfile" --no-push --destination registry.coadcorp.com/nathan/invertergui:pr-${DRONE_BUILD_NUMBER}
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: docker-publish-commit
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: registry.coadcorp.com
|
||||||
|
repo: registry.coadcorp.com/nathan/invertergui
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
username: nathan
|
||||||
|
password:
|
||||||
|
from_secret: registry_password
|
||||||
|
tags:
|
||||||
|
- ${DRONE_COMMIT_SHA}
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
- name: docker-publish-latest
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: registry.coadcorp.com
|
||||||
|
repo: registry.coadcorp.com/nathan/invertergui
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
username: nathan
|
||||||
|
password:
|
||||||
|
from_secret: registry_password
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
|
||||||
|
- name: docker-publish-release
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: registry.coadcorp.com
|
||||||
|
repo: registry.coadcorp.com/nathan/invertergui
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
username: nathan
|
||||||
|
password:
|
||||||
|
from_secret: registry_password
|
||||||
|
auto_tag: true
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
65
.github/workflows/docker-build.yml
vendored
65
.github/workflows/docker-build.yml
vendored
@@ -1,65 +0,0 @@
|
|||||||
# Tagging based on: https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
|
|
||||||
# Multi platform based on: https://docs.docker.com/build/ci/github-actions/multi-platform/
|
|
||||||
name: build
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
inverter_gui_pipeline:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: "Setup"
|
|
||||||
uses: actions/setup-go@v3
|
|
||||||
with:
|
|
||||||
go-version: '1.22'
|
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
uses: golangci/golangci-lint-action@v3
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
|
|
||||||
|
|
||||||
- name: Upload code coverage
|
|
||||||
uses: codecov/codecov-action@v3
|
|
||||||
|
|
||||||
- name: Generate docker image labels and tags
|
|
||||||
id: docker_meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ghcr.io/diebietse/invertergui
|
|
||||||
tags: |
|
|
||||||
type=ref,event=branch
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push to GitHub Container Registry
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
||||||
@@ -37,14 +37,14 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"invertergui/mk2core"
|
"git.coadcorp.com/nathan/invertergui/mk2core"
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
"invertergui/plugins/cli"
|
"git.coadcorp.com/nathan/invertergui/plugins/cli"
|
||||||
"invertergui/plugins/mqttclient"
|
"git.coadcorp.com/nathan/invertergui/plugins/mqttclient"
|
||||||
"invertergui/plugins/munin"
|
"git.coadcorp.com/nathan/invertergui/plugins/munin"
|
||||||
"invertergui/plugins/prometheus"
|
"git.coadcorp.com/nathan/invertergui/plugins/prometheus"
|
||||||
"invertergui/plugins/webui"
|
"git.coadcorp.com/nathan/invertergui/plugins/webui"
|
||||||
"invertergui/plugins/webui/static"
|
"git.coadcorp.com/nathan/invertergui/plugins/webui/static"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/tarm/serial"
|
"github.com/tarm/serial"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package mk2core
|
package mk2core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Core struct {
|
type Core struct {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
mqtt "github.com/eclipse/paho.mqtt.golang"
|
mqtt "github.com/eclipse/paho.mqtt.golang"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package mqttclient
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestServer(_ *testing.T) {
|
func TestServer(_ *testing.T) {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
package prometheus
|
package prometheus
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
"invertergui/websocket"
|
"git.coadcorp.com/nathan/invertergui/websocket"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"invertergui/mk2driver"
|
"git.coadcorp.com/nathan/invertergui/mk2driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
type templateTest struct {
|
type templateTest struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user