Skip to content

Adds goreleaser and github actions #18

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

Merged
merged 2 commits into from
Jun 22, 2021
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
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
38 changes: 38 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
branches:
- master
- main
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.41

build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
go: [1.16, 1.15]
steps:
- name: Setup
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out source
uses: actions/checkout@v2
- name: Build
run: make build
60 changes: 60 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '42 21 * * 3'

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@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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@v1

# ℹ️ 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@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ tmp
vendor
bin
.exe
dist/
63 changes: 63 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
before:
hooks:
- go mod tidy
builds:
- goos:
- linux
- darwin
- windows
ignore:
- goos: linux
goarch: 386
- goos: darwin
goarch: 386
- goos: windows
goarch: 386
id: "executor"
main: ./cmd/executor
binary: executor
- goos:
- linux
- darwin
- windows
ignore:
- goos: linux
goarch: 386
- goos: darwin
goarch: 386
- goos: windows
goarch: 386
id: "tradeclient"
main: ./cmd/tradeclient
binary: tradeclient
- goos:
- linux
- darwin
- windows
ignore:
- goos: linux
goarch: 386
- goos: darwin
goarch: 386
- goos: windows
goarch: 386
id: "ordermatch"
main: ./cmd/ordermatch
binary: ordermatch

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The QuickFIX Software License, Version 1.0

Copyright (c) 2001-2010 quickfixengine.org All rights
Copyright (c) 2001-present quickfixengine.org All rights
reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL := /bin/bash
test: lint vet build

lint:
golint ./...
golangci-lint run

vet:
go vet ./...
Expand Down
33 changes: 14 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
Example QuickFIX/Go Applications
================================
# Example QuickFIX/Go Applications

[![Build Status](https://travis-ci.org/quickfixgo/examples.svg?branch=master)](https://travis-ci.org/quickfixgo/examples)
[![Build Status](https://github.com/quickfixgo/examples/workflows/CI/badge.svg)](https://github.com/quickfixgo/examples/actions) [![GoDoc](https://godoc.org/github.com/quickfixgo/examples?status.png)](https://godoc.org/github.com/quickfixgo/examples) [![Go Report Card](https://goreportcard.com/badge/github.com/quickfixgo/examples)](https://goreportcard.com/report/github.com/quickfixgo/examples)

* TradeClient is a simple console based trading client
* Executor is a server that fills every limit order it receives
* OrderMatch is a primitive matching engine
* [TradeClient](cmd/tradeclient/README.md) is a simple console based trading client
* [Executor](cmd/executor/README.md) is a server that fills every limit order it receives
* [OrderMatch](cmd/ordermatch/README.md) is a primitive matching engine

All examples have been ported from [QuickFIX](http://quickfixengine.org)

Installation
------------
## Installation

To build and run the examples, you will first need [Go](http://www.golang.org) installed on your machine (version 1.6+ is *required*).
### Build From Source
To build and run the examples, you will first need [Go](https://www.golang.org) installed on your machine

For local dev first make sure Go is properly installed, including setting up a [GOPATH](http://golang.org/doc/code.html#GOPATH).

Next, using [Git](https://git-scm.com/), clone this repository into `$GOPATH/src/github.com/quickfixgo/examples`. All the necessary dependencies are either vendored, so you just need to type `make`. This will compile and install the examples into `$GOPATH/bin`. If this exits with exit status 0, then everything is working!
Next, clone this repository with `git clone git@github.com:quickfixgo/examples.git`. This project uses go modules, so you just need to type `make build`. This will compile the examples executables in the `./bin` dir in your local copy of the repo. If this exits with exit status 0, then everything is working! You may need to pull the module deps with `go mod download`.

```sh
$ make
make build
```

Running the Examples
--------------------
### Running the Examples

Following installation, the examples can be found in `$GOPATH/bin`. The examples are meant to be run in pairs- the TradeClient as a client of either the Executor or OrderMatch. By default, the examples will load the default configurations named after the example apps provided in the `config/` root directory. Eg, running `$GOPATH/bin/tradeclient` will load the `config/tradeclient.cfg` configuration. Each example can be run with a custom configuration as a command line argument (`$GOPATH/bin/tradeclient my_trade_client.cfg`).
Following installation, the examples can be found in `./bin`. The examples are meant to be run in pairs- the TradeClient as a client of either the Executor or OrderMatch. By default, the examples will load the default configurations named after the example apps provided in the `config/` root directory. <i>i.e.</i>, running `./bin/tradeclient` will load the `config/tradeclient.cfg` configuration. Each example can be run with a custom configuration as a command line argument (`./bin/tradeclient my_trade_client.cfg`).

Licensing
---------
### Licensing

This software is available under the QuickFIX Software License. Please see the [LICENSE.txt](https://github.com/quickfixgo/examples/blob/master/LICENSE.txt) for the terms specified by the QuickFIX Software License.
This software is available under the QuickFIX Software License. Please see the [LICENSE](LICENSE) for the terms specified by the QuickFIX Software License.
39 changes: 39 additions & 0 deletions cmd/executor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Executor

## Usage
A config file similar to the example config [here](../../config/executor.cfg) is required to run the executor.
The cli command usage takes the form of

```sh
executor [CONFIG_PATH_FILENAME]
```
where CONFIG_PATH_FILENAME defaults to `config/executor.cfg`

## Example Config Contents
```
[DEFAULT]
SocketAcceptPort=5001
SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileLogPath=tmp

[SESSION]
BeginString=FIX.4.0

[SESSION]
BeginString=FIX.4.1

[SESSION]
BeginString=FIX.4.2

[SESSION]
BeginString=FIX.4.3

[SESSION]
BeginString=FIX.4.4

[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=7
```
Loading