Skip to content

Commit

Permalink
Merge pull request #1 from Savid/feat/baseline
Browse files Browse the repository at this point in the history
feat: baseline
  • Loading branch information
Savid authored Sep 9, 2022
2 parents 352bf2c + b92f46d commit bad5682
Show file tree
Hide file tree
Showing 70 changed files with 1,145 additions and 6,436 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
args: --timeout 3m --verbose

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: goreleaser

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54 changes: 0 additions & 54 deletions .github/workflows/publish.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Go Test

on:
pull_request:

workflow_dispatch:
branches: [ '**' ]

jobs:
full_ci:
strategy:
matrix:
go_version: [ 1.18.x ]

runs-on: ubuntu-20.04

steps:
- name: checkout
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go_version }}

- name: run tests
run: go test -json ./... > test.json

- name: Annotate tests
if: always()
uses: guyarb/golang-test-annotations@v0.5.1
with:
test-results: test.json
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
ethereum-metrics-exporter
test_config.yaml
bin
.vscode
config.yaml
__debug_bin
ethereum-balance-metrics-exporter
5 changes: 1 addition & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ linters:
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exportloopref
- exhaustive
- goconst
- gocritic
- gofmt
Expand All @@ -36,7 +34,6 @@ linters:
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nolintlint
- nakedret
Expand All @@ -54,4 +51,4 @@ linters:
- wsl

run:
issues-exit-code: 1
issues-exit-code: 1
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# syntax=docker/dockerfile:1
FROM golang:1.18 AS builder
FROM golang:1.19 AS builder
WORKDIR /src
COPY go.sum go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /bin/app .

FROM ubuntu:latest
FROM ubuntu:latest
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
libssl-dev \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /bin/app /ethereum-metrics-exporter
ENTRYPOINT ["/ethereum-metrics-exporter"]
COPY --from=builder /bin/app /ethereum-balance-metrics-exporter
ENTRYPOINT ["/ethereum-balance-metrics-exporter"]
Loading

0 comments on commit bad5682

Please sign in to comment.