Skip to content
Open
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
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# update go modules
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/fix/golang" # Location of package manifests

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

круть! а для гитлаб есть подобное? может джоба в ci

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я уже задавал этот вопрос, и мне сказали что это не нужно =)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vs-code умеет, кстати
image

schedule:
interval: "weekly"

# Set update schedule for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/fix/golang"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
23 changes: 23 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Bump version
on:
workflow_run:
workflows: ["CI.build-test-lint"]
branches:
- master
- main
types:
- completed

jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

# check https://github.com/marketplace/actions/github-tag for creating auto-releases
50 changes: 50 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI.build-test-lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
branches:
- master
- main
permissions:
contents: read

jobs:
build-test-lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
go1_18_project:
- fix/golang
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.18'
- name: Install golangci-lint
run: |
curl -sSLO https://github.com/golangci/golangci-lint/releases/download/v$GOLANGCI_LINT_VERSION/golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz
shasum -a 256 golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz | grep "^$GOLANGCI_LINT_SHA256 " > /dev/null
tar -xf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz
sudo mv golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64/golangci-lint /usr/local/bin/golangci-lint
rm -rf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64*
env:
GOLANGCI_LINT_VERSION: '1.50.1'
GOLANGCI_LINT_SHA256: '4ba1dc9dbdf05b7bdc6f0e04bdfe6f63aa70576f51817be1b2540bbce017b69a'
- name: Build
run: cd ${{ matrix.go1_18_project }} && make build
- name: Test
run: cd ${{ matrix.go1_18_project }} && make test
- name: Lint
run: cd ${{ matrix.go1_18_project }} && make lint

75 changes: 75 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches:
- master
- main
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
- main
schedule:
- cron: '55 05 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist
.sass-cache
bower_components
target
bin
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
https://exmo.com/api_doc

### Supported languages:
- php.
- js.
- nodejs.
- c#.
- c++11.
- python.
- objective c.
- swift.
- java.
- ruby.
- golang.
- R.
| | rest | ws | fix |
|-------------|------------------------|---------------------------------------------------|-------------------|
| php | [yes](rest/php) | | |
| js | [yes](rest/js) | [yes](ws/js) | |
| nodejs | [yes](rest/nodejs) | | |
| c# | [yes](rest/c%23) | [yes](ws/.net) | |
| c++11 | [yes](rest/с++) | | |
| python | [yes](rest/python) | [python2](ws/python2) <br/> [python3](ws/python3) | |
| objective c | [yes](rest/objectivec) | | |
| swift | [yes](rest/swift) | | |
| java | [yes](rest/java) | [yes](ws/java) | |
| ruby | [yes](rest/ruby) | | |
| golang | [yes](rest/golang) | [yes](ws/golang) | [yes](fix/golang) |
| R | [yes](rest/r) | | |
102 changes: 102 additions & 0 deletions fix/golang/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
run:
timeout: 30s

linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- cyclop
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exhaustruct
- exportloopref
- forbidigo
- forcetypeassert
- funlen
# - gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- grouper
- importas
- interfacebloat
# - ireturn
- lll
- loggercheck
- maintidx
- makezero
- misspell
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
# - paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
- sqlclosecheck
- stylecheck
- tagliatelle
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
- varnamelen
- wastedassign
- whitespace
- wrapcheck
- wsl

linters-settings:
gofmt:
simplify: true
goimports:
local-prefixes: gitlab.exmoney.com/golang/exmo_api_lib/fix/golang

17 changes: 17 additions & 0 deletions fix/golang/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

dep: ; go mod tidy

.PHONY: run
run: dep ; go run *.go

.PHONY: all
all: build test lint

.PHONY: build
build: dep ; go build -o bin/exmo-fix-client ./...

.PHONY: test
test: dep ; go test ./...

.PHONY: lint
lint: ; golangci-lint run
Loading