Fix ci settings ()

This commit is contained in:
Daniel 2021-12-12 00:30:03 +03:00 committed by GitHub
parent 95645c59cc
commit 93385f0955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 58 deletions

View File

@ -7,19 +7,6 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Dependencies
run: npm ci
- name: Run check
run: npm run check
- name: Run test
run: npm t
- name: Run lint
run: npm run lint
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
@ -29,5 +16,5 @@ jobs:
- name: Check out code
uses: actions/checkout@v2
- name: Run check (sanity only)
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=sanity-check
- name: Run check
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=checker

View File

@ -1,24 +1,28 @@
name: Fixes (sanity and consistency) - Dry run
name: Fix (Dry run)
on:
pull_request:
branches: [master]
branches: master
jobs:
fix-all-dryrun:
fix-dryrun:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
node-version: 12
- name: Install Dependencies
run: npm ci
- name: Run fix script
run: npm run fix
- name: Show fix result (diff); run 'npm run fix' locally
go-version: 1.17
id: go
- name: Check out code
uses: actions/checkout@v2
- name: Run fix
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=fixer
- name: Show fix result (diff)
run: |
git status
git diff
- name: Run check
run: npm run check
- name: Run test
run: npm t
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=checker

View File

@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v2
- name: Run update auto
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=update-auto
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=updater-auto
- name: Show update result (diff)
if: success()
@ -32,7 +32,7 @@ jobs:
git diff
- name: Run check
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=sanity-check
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=checker
- name: Commit changes
if: success()

View File

@ -20,5 +20,5 @@ jobs:
- name: Check out code
uses: actions/checkout@v2
- name: Run check (sanity only)
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=sanity-check
- name: Run check
run: go run ./cmd/main.go --config=./.github/assets.config.yaml --script=checker

View File

@ -2,7 +2,6 @@ package main
import (
"flag"
"os"
log "github.com/sirupsen/logrus"
@ -10,7 +9,6 @@ import (
"github.com/trustwallet/assets-go-libs/src/config"
"github.com/trustwallet/assets-go-libs/src/core"
"github.com/trustwallet/assets-go-libs/src/processor"
"github.com/trustwallet/assets-go-libs/src/reporter"
)
var (
@ -27,13 +25,14 @@ func main() {
fileStorage := file.NewService()
validatorsService := core.NewService(fileStorage)
reportService := reporter.NewReportService()
assetfsProcessor := processor.NewService(fileStorage, validatorsService, reportService)
assetfsProcessor := processor.NewService(fileStorage, validatorsService)
switch script {
case "sanity-check":
err = assetfsProcessor.RunSanityCheck(paths)
case "update-auto":
case "checker":
err = assetfsProcessor.RunJob(paths, assetfsProcessor.Check)
case "fixer":
err = assetfsProcessor.RunJob(paths, assetfsProcessor.Fix)
case "updater-auto":
err = assetfsProcessor.RunUpdateAuto()
default:
log.Error("Nothing to launch. Use --script flag to choose a script to run.")
@ -42,21 +41,6 @@ func main() {
if err != nil {
log.WithError(err).Error()
}
reports := reportService.GetReports()
for key, report := range reports {
log.WithFields(log.Fields{
"total_files": report.TotalFiles,
"errors": report.Errors,
"warnings": report.Warnings,
"fixed": report.Fixed,
}).Info(key)
if report.Errors > 0 {
os.Exit(1)
}
}
}
func setup() {

2
go.mod
View File

@ -4,7 +4,7 @@ go 1.17
require (
github.com/sirupsen/logrus v1.8.1
github.com/trustwallet/assets-go-libs v0.0.11
github.com/trustwallet/assets-go-libs v0.0.12-0.20211211200802-4ccd693c8b08
)
require (

10
go.sum
View File

@ -272,8 +272,14 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/trustwallet/assets-go-libs v0.0.11 h1:r1fLiHTYrzA38xCPmcW3PU0Mr2wRgSl/E/NKXIlHhfE=
github.com/trustwallet/assets-go-libs v0.0.11/go.mod h1:ap6mIFsVjpRI8lXS1UX9/xAwJgaXGm9BHDxAxkQHkFc=
github.com/trustwallet/assets-go-libs v0.0.12-0.20211210154426-b38f9a1b5ad5 h1:YSRZYJq5cYa58ZWbjqaJL0LASrx0kbCkjF68lf0lIac=
github.com/trustwallet/assets-go-libs v0.0.12-0.20211210154426-b38f9a1b5ad5/go.mod h1:ap6mIFsVjpRI8lXS1UX9/xAwJgaXGm9BHDxAxkQHkFc=
github.com/trustwallet/assets-go-libs v0.0.12-0.20211211195553-bf00b6d5a687 h1:eeBJ06PPaybsyG+kIJ1gSDgCUnRROcQor1XAX7ZtxiY=
github.com/trustwallet/assets-go-libs v0.0.12-0.20211211195553-bf00b6d5a687/go.mod h1:ap6mIFsVjpRI8lXS1UX9/xAwJgaXGm9BHDxAxkQHkFc=
github.com/trustwallet/assets-go-libs v0.0.12-0.20211211195751-c5d6cf4e6b74 h1:A1w3epAenNWpY3eO/cGAObLhbHBJ9EWutBYk4Ox3VtY=
github.com/trustwallet/assets-go-libs v0.0.12-0.20211211195751-c5d6cf4e6b74/go.mod h1:ap6mIFsVjpRI8lXS1UX9/xAwJgaXGm9BHDxAxkQHkFc=
github.com/trustwallet/assets-go-libs v0.0.12-0.20211211200802-4ccd693c8b08 h1:rWCyIa7S0nLZQIGbiWkJ0F018VD2lJ/AzAs8wzaFAyc=
github.com/trustwallet/assets-go-libs v0.0.12-0.20211211200802-4ccd693c8b08/go.mod h1:ap6mIFsVjpRI8lXS1UX9/xAwJgaXGm9BHDxAxkQHkFc=
github.com/trustwallet/go-libs v0.2.20 h1:pYstFNgsc7CVyVeYt5GHsMa0JNQHJVRvPQqMvXMpCtY=
github.com/trustwallet/go-libs v0.2.20/go.mod h1:7QdAp1lcteKKI0DYqGoaO8KO4eTNYjGmg8vHy0YXkKc=
github.com/trustwallet/go-primitives v0.0.17 h1:1fBxZMKGCHdHtgdUzsqdFlD21+1GneIk/sxN6jxYBds=