Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update github workflow #315

Merged
merged 3 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Gosec
on:
push:
branches:
- feature/dev
- development
pull_request:
branches:
- feature/dev
- development
jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: Run Gosec Security Scanner
uses: informalsystems/gosec@master
with:
args: ./...
24 changes: 0 additions & 24 deletions .github/workflows/lint.yaml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Lint
on:
pull_request:
push:
branches:
- development
- feature/dev

jobs:
golangci:
name: Run golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Get data from build cache
uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Linter cache (Linux)
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: ${{ runner.os }}-go-linter-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-linter-${{ matrix.go-version }}-
- name: Run golangci-lint
run: make lint
if: env.GIT_DIFF

documentation-linter:
name: Run super-linter
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files
# within `super-linter`.
fetch-depth: 0
- name: Run documentation linter
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: true
DEFAULT_BRANCH: development
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Tests & Code Coverage

on:
pull_request:
branches:
- "**"
push:
branches:
- "development"
- "feature/dev"
workflow_dispatch:

jobs:
should_run_go_test:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
-
id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: "true" # workflow-runs from outdated commits will be cancelled.
concurrent_skipping: "same_content"
skip_after_successful_duplicate: "true"
paths: '["**/*.go", "**/*.mod", "**/*.sum"]'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
-
name: Skipping test
run: echo Should I skip tests? ${{ steps.skip_check.outputs.should_skip }}

go_test:
needs: should_run_go_test
if: ${{ needs.should_run_test.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
-
name: Check out repository code
uses: actions/checkout@v2
-
name: Setup Golang
uses: actions/[email protected]
with:
go-version: 1.18
-
name: Display go version
run: go version
-
name: Get data from build cache
uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
-
name: Run all tests
run: make test-unit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/.idea/
/target/
/release/
/build/
/build/
/cover.out
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ endif
#$(info $$BUILD_FLAGS is [$(BUILD_FLAGS)])


all: install
all: install test

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/comdex
Expand All @@ -96,6 +96,18 @@ build:
go build $(BUILD_FLAGS) -o bin/comdex ./cmd/comdex


###############################################################################
### Linting ###
###############################################################################

lint:
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout=10m

format:
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --fix
@go run mvdan.cc/gofumpt -l -w x/ app/ ante/ tests/


###############################################################################
### Tests & Simulation ###
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<h1 align="center">Comdex : Democratizing Finance </h1>

<p align="center">
<img src="./logo.svg" width="300">
</p>
<h3 align="center">Democratizing Finance </h3>

<div align="center">
<h4> An ecosystem of solutions built with an aim of bridging DeFi & CeFi </h4>
Expand Down Expand Up @@ -34,10 +35,10 @@ make install

## Testnet

To verify latest testnet and main net version check
To verify latest testnet and main net version check
[Version](https://github.com/comdex-official/networks/blob/main/README.md)

For further information on joining the testnet, head over to the
For further information on joining the testnet, head over to the
[Comdex Networks TestNet](https://github.com/comdex-official/networks/tree/main/testnet).

The explorer for this chain is hosted [TestNet Explorer](https://comets-test.comdex.one/)
Expand All @@ -47,7 +48,7 @@ For further information on joining the mainnet, head over to the
[Comdex Networks MainNet](https://github.com/comdex-official/networks/tree/main/mainnet).


## Mainet Explorers
## Mainet Explorers
The explorer for this chain is hosted

* [Mintscan](https://www.mintscan.io/comdex/)
Expand Down
Loading