mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
Fix ci settings (#16532)
This commit is contained in:
parent
95645c59cc
commit
93385f0955
17
.github/workflows/check.yml
vendored
17
.github/workflows/check.yml
vendored
|
@ -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
|
32
.github/workflows/fix-dryrun.yml
vendored
32
.github/workflows/fix-dryrun.yml
vendored
|
@ -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
|
4
.github/workflows/periodic-update.yml
vendored
4
.github/workflows/periodic-update.yml
vendored
|
@ -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()
|
||||
|
|
4
.github/workflows/pr-ci.yml
vendored
4
.github/workflows/pr-ci.yml
vendored
|
@ -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
|
28
cmd/main.go
28
cmd/main.go
|
@ -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
2
go.mod
|
@ -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
10
go.sum
|
@ -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=
|
||||
|
|
Loading…
Reference in New Issue
Block a user