Skip to content

Commit

Permalink
Merge pull request #15 from KendrickAng/main
Browse files Browse the repository at this point in the history
merging upstream
  • Loading branch information
javiersuweijie authored Jun 15, 2023
2 parents 7d62873 + 3574e71 commit a202cfe
Show file tree
Hide file tree
Showing 159 changed files with 46,799 additions and 36,260 deletions.
4 changes: 0 additions & 4 deletions .dockerignore

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on: [push, pull_request]
name: every commit
jobs:

build:
runs-on: ubuntu-latest
name: build
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: 1.20.0
- run: go build ./...

test:
runs-on: ubuntu-latest
name: test
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.0
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: go test ./...

# Use --check or --exit-code when available (Go 1.19?)
# https://github.com/golang/go/issues/27005
tidy:
runs-on: ubuntu-latest
name: tidy
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: 1.20.0
- run: |
go mod tidy
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
56 changes: 0 additions & 56 deletions .github/workflows/docker-image.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run Gosec
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v3
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- name: Run Gosec Security Scanner
uses: informalsystems/gosec@master
with:
args: ./...
if: "env.GIT_DIFF != ''"
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint
# Lint runs golangci-lint over the entire Gaia repository
# This workflow is run on every pull request and push to main
# The `golangci` job will pass without running if no *.{go, mod, sum} files have been modified.
on:
pull_request:
push:
branches:
- main
jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.20.0
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v4
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.51.2
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: "env.GIT_DIFF != ''"
26 changes: 26 additions & 0 deletions .github/workflows/simulation-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Simulation Test

on:
# Triggers the workflow on pull request events but only for the 'main' branch
pull_request:
branches: ["main"]
workflow_dispatch:

jobs:
simulation-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Download Modules
run: go mod download

- name: Test
id: test
run: go test -v -run=TestFullAppSimulation ./app -NumBlocks 200 -BlockSize 50 -Commit -Enabled -Period 1
47 changes: 47 additions & 0 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# name: Test Coverage
# on:
# pull_request:
# push:
# branches:
# - main
# jobs:
# cleanup-runs:
# runs-on: ubuntu-latest
# steps:
# - uses: rokroskar/workflow-run-cleanup-action@master
# env:
# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
#
# test-coverage-upload:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/setup-go@v4
# with:
# go-version: 1.20.0
# - uses: actions/checkout@v3
# - uses: technote-space/get-diff-action@v4
# with:
# PATTERNS: |
# **/**.go
# go.mod
# go.sum
# - name: test & coverage report creation
# run: |
# go test ./... -mod=readonly -timeout 12m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
# if: "env.GIT_DIFF != ''"
# - name: filter out DONTCOVER
# run: |
# excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
# excludelist+=" $(find ./ -type f -name '*.pb.go')"
# for filename in ${excludelist}; do
# filename=$(echo $filename | sed 's/^./github.com\/terra-money\/core\/v2/g')
# echo "Excluding ${filename} from coverage report..."
# sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
# done
# if: "env.GIT_DIFF != ''"
# - uses: codecov/codecov-action@v1
# with:
# file: ./coverage.txt # optional
# fail_ci_if_error: true
# if: "env.GIT_DIFF != ''"
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ release/
.DS_Store
dist
build

vendor/
tmp-swagger-gen/
.test-data/
coverage.txt
target/
99 changes: 0 additions & 99 deletions Dockerfile

This file was deleted.

Loading

0 comments on commit a202cfe

Please sign in to comment.