Skip to content

Commit 76e9c70

Browse files
authored
Merge pull request #18 from ackleymi/main
Adds goreleaser and github actions
2 parents 63f3d0f + 09edd6f commit 76e9c70

File tree

17 files changed

+394
-104
lines changed

17 files changed

+394
-104
lines changed

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10

.github/workflows/ci.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
- main
9+
pull_request:
10+
branches:
11+
- master
12+
- main
13+
jobs:
14+
golangci:
15+
name: lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: golangci-lint
20+
uses: golangci/golangci-lint-action@v2
21+
with:
22+
version: v1.41
23+
24+
build:
25+
name: build
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
go: [1.16, 1.15]
30+
steps:
31+
- name: Setup
32+
uses: actions/setup-go@v2
33+
with:
34+
go-version: ${{ matrix.go }}
35+
- name: Check out source
36+
uses: actions/checkout@v2
37+
- name: Build
38+
run: make build

.github/workflows/codeql-analysis.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ main ]
9+
schedule:
10+
- cron: '42 21 * * 3'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: [ 'go' ]
25+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
26+
# Learn more:
27+
# 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
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v2
32+
33+
# Initializes the CodeQL tools for scanning.
34+
- name: Initialize CodeQL
35+
uses: github/codeql-action/init@v1
36+
with:
37+
languages: ${{ matrix.language }}
38+
# If you wish to specify custom queries, you can do so here or in a config file.
39+
# By default, queries listed here will override any specified in a config file.
40+
# Prefix the list here with "+" to use these queries and those in the config file.
41+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
42+
43+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
44+
# If this step fails, then you should remove it and run the build manually (see below)
45+
- name: Autobuild
46+
uses: github/codeql-action/autobuild@v1
47+
48+
# ℹ️ Command-line programs to run using the OS shell.
49+
# 📚 https://git.io/JvXDl
50+
51+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
52+
# and modify them (or add more) to build your code if your project
53+
# uses a compiled language
54+
55+
#- run: |
56+
# make bootstrap
57+
# make release
58+
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@v1

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ tmp
33
vendor
44
bin
55
.exe
6+
dist/

.goreleaser.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- goos:
6+
- linux
7+
- darwin
8+
- windows
9+
ignore:
10+
- goos: linux
11+
goarch: 386
12+
- goos: darwin
13+
goarch: 386
14+
- goos: windows
15+
goarch: 386
16+
id: "executor"
17+
main: ./cmd/executor
18+
binary: executor
19+
- goos:
20+
- linux
21+
- darwin
22+
- windows
23+
ignore:
24+
- goos: linux
25+
goarch: 386
26+
- goos: darwin
27+
goarch: 386
28+
- goos: windows
29+
goarch: 386
30+
id: "tradeclient"
31+
main: ./cmd/tradeclient
32+
binary: tradeclient
33+
- goos:
34+
- linux
35+
- darwin
36+
- windows
37+
ignore:
38+
- goos: linux
39+
goarch: 386
40+
- goos: darwin
41+
goarch: 386
42+
- goos: windows
43+
goarch: 386
44+
id: "ordermatch"
45+
main: ./cmd/ordermatch
46+
binary: ordermatch
47+
48+
archives:
49+
- replacements:
50+
darwin: Darwin
51+
linux: Linux
52+
windows: Windows
53+
amd64: x86_64
54+
checksum:
55+
name_template: 'checksums.txt'
56+
snapshot:
57+
name_template: "{{ .Tag }}-next"
58+
changelog:
59+
sort: asc
60+
filters:
61+
exclude:
62+
- '^docs:'
63+
- '^test:'

.travis.yml

-23
This file was deleted.

LICENSE.txt renamed to LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The QuickFIX Software License, Version 1.0
22

3-
Copyright (c) 2001-2010 quickfixengine.org All rights
3+
Copyright (c) 2001-present quickfixengine.org All rights
44
reserved.
55

66
Redistribution and use in source and binary forms, with or without

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SHELL := /bin/bash
33
test: lint vet build
44

55
lint:
6-
golint ./...
6+
golangci-lint run
77

88
vet:
99
go vet ./...

README.md

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
1-
Example QuickFIX/Go Applications
2-
================================
1+
# Example QuickFIX/Go Applications
32

4-
[![Build Status](https://travis-ci.org/quickfixgo/examples.svg?branch=master)](https://travis-ci.org/quickfixgo/examples)
3+
[![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)
54

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

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

12-
Installation
13-
------------
11+
## Installation
1412

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

17-
For local dev first make sure Go is properly installed, including setting up a [GOPATH](http://golang.org/doc/code.html#GOPATH).
18-
19-
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!
16+
Next, clone this repository with `git clone [email protected]: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`.
2017

2118
```sh
22-
$ make
19+
make build
2320
```
2421

25-
Running the Examples
26-
--------------------
22+
### Running the Examples
2723

28-
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`).
24+
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`).
2925

30-
Licensing
31-
---------
26+
### Licensing
3227

33-
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.
28+
This software is available under the QuickFIX Software License. Please see the [LICENSE](LICENSE) for the terms specified by the QuickFIX Software License.

cmd/executor/README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Executor
2+
3+
## Usage
4+
A config file similar to the example config [here](../../config/executor.cfg) is required to run the executor.
5+
The cli command usage takes the form of
6+
7+
```sh
8+
executor [CONFIG_PATH_FILENAME]
9+
```
10+
where CONFIG_PATH_FILENAME defaults to `config/executor.cfg`
11+
12+
## Example Config Contents
13+
```
14+
[DEFAULT]
15+
SocketAcceptPort=5001
16+
SenderCompID=ISLD
17+
TargetCompID=TW
18+
ResetOnLogon=Y
19+
FileLogPath=tmp
20+
21+
[SESSION]
22+
BeginString=FIX.4.0
23+
24+
[SESSION]
25+
BeginString=FIX.4.1
26+
27+
[SESSION]
28+
BeginString=FIX.4.2
29+
30+
[SESSION]
31+
BeginString=FIX.4.3
32+
33+
[SESSION]
34+
BeginString=FIX.4.4
35+
36+
[SESSION]
37+
BeginString=FIXT.1.1
38+
DefaultApplVerID=7
39+
```

0 commit comments

Comments
 (0)