Skip to content

Commit

Permalink
Merge pull request #193 from sourcenetwork/release/0.2.0
Browse files Browse the repository at this point in the history
Release v.0.2
  • Loading branch information
jsimnz authored Feb 7, 2022
2 parents c113312 + 0346813 commit 3b7ff1c
Show file tree
Hide file tree
Showing 255 changed files with 25,679 additions and 3,010 deletions.
24 changes: 24 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }}

> {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}

{{ range .Commits -}}
* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}

{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
41 changes: 41 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/sourcenetwork/defradb
options:
commits:
filters:
Type:
- feat
- fix
- perf
- refactor
commit_groups:
title_maps:
feat: Features
fix: Bug fixes
perf: Performance
refactor: Refactoring
ci: Continous integration
docs: Documentation
test: Testing
sort_by: Custom
title_order:
- feat
- fix
- docs
- test
- perf
- refactor
- ci
- chore
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
9 changes: 6 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: circleci/golang:1.15.8
- image: circleci/golang:1.17.5
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
Expand All @@ -20,16 +20,19 @@ jobs:
- go-mod-v4-{{ checksum "go.sum" }}
- run:
name: Install Dependencies
command: go mod download
command: make deps
- save_cache:
key: go-mod-v4-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
- run:
name: Run tests
command: |
DEFRA_BADGER_MEMORY=true
DEFRA_BADGER_FILE=true
DEFRA_MAP=true
mkdir -p /tmp/test-reports
gotestsum --junitfile /tmp/test-reports/unit-tests.xml
gotestsum --junitfile /tmp/test-reports/unit-tests.xml -- ./... -race
- store_test_results:
path: /tmp/test-reports

Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/benchmark-ec2-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: benchmark-ec2-runner

on: pull_request

jobs:

start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}

steps:

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.REPO_SCOPE_PAT }}
ec2-image-id: ${{ secrets.EC2_IMAGE_ID }}
ec2-instance-type: t3.xlarge
subnet-id: ${{ secrets.SUBNET_ID }}
security-group-id: ${{ secrets.SECURITY_GROUP_ID }}
## iam-role-name: my-role-name # optional, requires additional permissions
## aws-resource-tags: > # optional, requires additional permissions
## [
## {"Key": "Name", "Value": "ec2-github-runner"},
## {"Key": "GitHubRepository", "Value": "${{ github.repository }}"}
## ]

benchmark-ec2-runner:

name: Run the benchmarks on the started EC2 runner
needs: start-runner # required to start the main job when the runner is ready

runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner

steps:
- name: Setup benchmarks
run: echo 'Replace with Johns Benchmarking Command Steps'

stop-runner:

name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- benchmark-ec2-runner # required to wait when the main job is done

runs-on: ubuntu-latest

if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs

steps:

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.REPO_SCOPE_PAT }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
33 changes: 33 additions & 0 deletions .github/workflows/code-test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Code Test Coverage

on: [push]

jobs:
code-test-coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17.5'

- name: Generate full test coverage report using go-acc
run: make test:coverage-full

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ./coverage-full.txt
flags: defra-tests
name: codecov-umbrella
verbose: true
# path_to_write_report: ./coverage/codecov_report.txt
# directory: ./coverage/reports/
59 changes: 59 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: golangci-lint

on:
pull_request:

push:
tags:
- v*
branches:
- master
- develop

permissions:
# Optional: allow read access to pull request. Need this if we use the `only-new-issues` option.
pull-requests: read
contents: read

jobs:
golangci:
strategy:
matrix:
go-version: [1.17.5]
os: [ubuntu-latest]

name: lint
runs-on: ${{ matrix.os }}

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: golangci-lint
uses: golangci/golangci-lint-action@v2

with:
# Required: the version of golangci-lint is required.
# Note: The version should not pick the patch version as the latest patch
# version is what will always be used.
version: v1.43

# Optional: working directory, useful for monorepos or if we wanted to run this
# on a non-root directory.
# working-directory: ./

# Optional: golangci-lint command line arguments.
# Note: we can set `--issues-exit-code=0` if we want a successcode always,
# indicating that the linter ran successfully (weather or not linter errors
# exist or not doesn't matter). But the good think is that the annotations
# will still show up. I think this can be useful if we don't want the pipeline
# to stop just because we had some linter errors.
args: --issues-exit-code=1 --config .golangci.sourceinc.yaml

# Optional: we can set the below to `true` if we only want to see newly introduced
# linter errors, however I found that in practive that option is a bit gimmicky,
# as it passes the linter check despite having new linter errors in some cases.
# So we opt in for all annotations of linter errors to show up, this is actually
# nicer because we suppress our linter errors manually anyways so there shouldn't
# be any linter errors anyways. The enforces us to always have a clean lint state.
only-new-issues: false
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
cli/defradb/defradb
cli/defradb/defradb.exe
build/defradb-*
build/defradb*
cover.out
coverage-full.txt
coverage-quick.txt
bench/*.log
bench/*.svg
Loading

0 comments on commit 3b7ff1c

Please sign in to comment.