Skip to content

Commit

Permalink
PMM-7602 GitHub Action (#30)
Browse files Browse the repository at this point in the history
* PMM-7602 GitHub Action

* PMM-7602 Fix method name.

* PMM-7602 Fix modules.
  • Loading branch information
askomorokhov authored Jun 3, 2021
1 parent 76e8fbe commit e1657b5
Show file tree
Hide file tree
Showing 821 changed files with 1,366 additions and 286,994 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Go

on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:

jobs:
test:
name: Test
strategy:
matrix:
go-version:
- 1.15
- 1.16
include:
- go-version: tip
os: ubuntu-latest
postgresql-image: postgres:12
may-fail: true
runs-on: ubuntu-latest
# The environment this job references
environment:
name: CI
steps:
- name: Set up Go release
if: matrix.go-version != 'tip'
uses: percona-platform/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Go tip
if: matrix.go-version == 'tip'
env:
# to avoid error due to `go version` accepting -v flag with an argument since 1.15
GOFLAGS: ""
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
- name: Checkout code
uses: percona-platform/checkout@v2
- name: Run checks
run: |
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
go build -modfile=tools/go.mod -o bin/reviewdog github.com/reviewdog/reviewdog/cmd/reviewdog
bin/golangci-lint run -c=.golangci-required.yml --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -level=error -reporter=github-pr-check
bin/golangci-lint run -c=.golangci.yml --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -level=error -reporter=github-pr-review
- name: Run Install
run: go install -v ./...
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
go version
go env
pwd
git status
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/prometheus/node_exporter
module github.com/percona/node_exporter

require (
github.com/beevik/ntp v0.2.0
Expand All @@ -22,4 +22,4 @@ require (
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)

go 1.13
go 1.16
2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2 changes: 1 addition & 1 deletion node_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
"sort"

"github.com/percona/exporter_shared"
"github.com/percona/node_exporter/collector"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"github.com/prometheus/common/version"
"github.com/prometheus/node_exporter/collector"
"gopkg.in/alecthomas/kingpin.v2"
)

Expand Down
9 changes: 9 additions & 0 deletions tools/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/percona/node_exporter/tools

go 1.16

require (
github.com/golangci/golangci-lint v1.40.1
github.com/prometheus/promu v0.12.0
github.com/reviewdog/reviewdog v0.11.0
)
1,279 changes: 1,279 additions & 0 deletions tools/go.sum

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions tools/tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// node_exporter

//go:build tools
// +build tools

package tools

import (
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/prometheus/promu"
_ "github.com/reviewdog/reviewdog/cmd/reviewdog"
)
27 changes: 0 additions & 27 deletions vendor/github.com/alecthomas/template/LICENSE

This file was deleted.

25 changes: 0 additions & 25 deletions vendor/github.com/alecthomas/template/README.md

This file was deleted.

Loading

0 comments on commit e1657b5

Please sign in to comment.