Skip to content

Commit

Permalink
Run test instead
Browse files Browse the repository at this point in the history
  • Loading branch information
batphonghan committed Feb 15, 2024
1 parent 04eb40c commit b241274
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 60 deletions.
68 changes: 16 additions & 52 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,19 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Golangci
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: latest

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

# Optional: golangci-lint command line arguments.
#
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0

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

# Optional: if set to true, then all caching functionality will be completely disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
# skip-build-cache: true

# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: Install dependencies
run: go get .
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test
2 changes: 2 additions & 0 deletions shared/services/beacon/client/std-http-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,12 @@ func (c *StandardHttpClient) getNodeVersion() (NodeVersionResponse, error) {
if status != http.StatusOK {
return NodeVersionResponse{}, fmt.Errorf("Could not get node sync status: HTTP status %d; response body: '%s'", status, string(responseBody))
}

var nodeVersion NodeVersionResponse
if err := json.Unmarshal(responseBody, &nodeVersion); err != nil {
return NodeVersionResponse{}, fmt.Errorf("Could not decode node sync status: %w", err)
}

return nodeVersion, nil
}

Expand Down
2 changes: 1 addition & 1 deletion shared/services/gas/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func handleEtherscanGasPrices(gasSuggestion etherscan.GasFeeSuggestion, priority

desiredPriceFloat, err := strconv.ParseFloat(desiredPrice, 64)
if err != nil {
fmt.Println("Not a valid gas price (%s), try again.", err.Error())
fmt.Printf("Not a valid gas price (%s), try again.\n", err.Error())
continue
}
if desiredPriceFloat <= 0 {
Expand Down
2 changes: 1 addition & 1 deletion shared/services/requirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func waitBeaconClientSynced(c *cli.Context, verbose bool, timeout int64) (bool,
// Check sync status
if syncStatus.Syncing {
if verbose {
log.Println("Eth 2.0 node syncing: %.2f%%\n", syncStatus.Progress*100)
log.Println("Eth 2.0 node syncing: %.2f%%", syncStatus.Progress*100)
}
} else {
return true, nil
Expand Down
2 changes: 1 addition & 1 deletion shared/services/stader/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (c *Client) UpdatePrometheusConfiguration(settings map[string]string) error
}
err = os.Chmod(prometheusConfigPath, 0664)
if err != nil {
return fmt.Errorf("Could not set Prometheus config file permissions: %w", shellescape.Quote(prometheusConfigPath), err)
return fmt.Errorf("Could not set Prometheus config file permissions: %s, %w", shellescape.Quote(prometheusConfigPath), err)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion stader-cli/node/claim-sp-rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func ClaimSpRewards(c *cli.Context) error {
cycleIndexes = append(cycleIndexes, big.NewInt(cycleInfo.MerkleProofInfo.Cycle))
}

fmt.Println("Following are the unclaimed cycles, Please enter in a comma seperated string the cycles you want to claim rewards for:\n")
fmt.Println("Following are the unclaimed cycles, Please enter in a comma separated string the cycles you want to claim rewards for:")

fmt.Printf("%-18s%-14.30s%-14.10s%-10s\n", "Cycle Number", "Cycle Date", "ETH Rewards", "SD Rewards")
cyclesToClaim := map[int64]bool{}
Expand Down
6 changes: 3 additions & 3 deletions stader-cli/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ func pruneExecutionClient(c *cli.Context) error {
}

fmt.Println("This will shut down your main execution client and prune its database, freeing up disk space.")
fmt.Println("Once pruning is complete, your execution client will restart automatically.\n")
fmt.Println("Once pruning is complete, your execution client will restart automatically.")

if selectedEc == cfgtypes.ExecutionClient_Geth {
if cfg.UseFallbackClients.Value == false {
Expand Down Expand Up @@ -1488,7 +1488,7 @@ func exportEcData(c *cli.Context, targetDir string) error {

fmt.Println("This will export your execution client's chain data to an external directory, such as a portable hard drive.")
fmt.Println("If your execution client is running, it will be shut down.")
fmt.Println("Once the export is complete, your execution client will restart automatically.\n")
fmt.Println("Once the export is complete, your execution client will restart automatically.")

// Get the container prefix
prefix, err := getContainerPrefix(staderClient)
Expand Down Expand Up @@ -1606,7 +1606,7 @@ func importEcData(c *cli.Context, sourceDir string) error {

fmt.Println("This will import execution layer chain data that you previously exported into your execution client.")
fmt.Println("If your execution client is running, it will be shut down.")
fmt.Println("Once the import is complete, your execution client will restart automatically.\n")
fmt.Println("Once the import is complete, your execution client will restart automatically.")

// Get the volume to import into
executionContainerName := prefix + ExecutionContainerSuffix
Expand Down
2 changes: 1 addition & 1 deletion stader/node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestVerifySignature(t *testing.T) {
ExecutionClient: ExecutionClient,
ConsensusClient: ConsensusClient,
ValidatorClient: ValidatorClient,
TotalNonTerminalKeys: 1,
TotalNonTerminalKeys: 10,
NodeAddress: crypto.PubkeyToAddress(*publicKeyECDSA).String(),
NodePublicKey: hex.EncodeToString(pubkeyBytes),
Relays: "ultrasound,aestus",
Expand Down

0 comments on commit b241274

Please sign in to comment.