Skip to content

Commit

Permalink
add godog test framework
Browse files Browse the repository at this point in the history
  • Loading branch information
ctnguyen committed Sep 24, 2021
1 parent 5cc97a1 commit 48281ce
Show file tree
Hide file tree
Showing 2,092 changed files with 647,181 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots & Logs**
If applicable, add screenshots or log dumps to help explain your problem.

**System Information (please complete the following information):**

- OS: [e.g. `macOS Catalina Version: 10.15.4`]
- Go version: [e.g. `go version go1.14.1 darwin/amd64`]
- libsv version: [e.g. `v0.0.1`]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. libsv is missing support for "Merkle tree" manipulation.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Basic dependabot.yml to update gomod

version: 2
updates:
- package-ecosystem: "gomod"
target-branch: "master"
directory: "/"
schedule:
interval: "daily"
# Check for npm updates at 9am UTC (5am EST)
time: "10:00"
reviewers:
- "jadwahab"
assignees:
- "jadwahab"
# Labels must be created first
labels:
- "update"
232 changes: 232 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
pull_request_rules:

# ===============================================================================
# DEPENDABOT
# ===============================================================================

- name: Automatic Merge for Dependabot Minor Version Pull Requests
conditions:
- -draft
- author~=^dependabot(|-preview)\[bot\]$
- check-success='lint (1.15.x, ubuntu-latest)'
- check-success='lint (1.16.x, ubuntu-latest)'
- check-success='lint (1.15.x, macos-latest)'
- check-success='lint (1.16.x, macos-latest)'
- check-success='Analyze (go)'
- title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
actions:
review:
type: APPROVE
message: Automatically approving dependabot pull request
merge:
method: merge
- name: Alert on major version detection
conditions:
- author~=^dependabot(|-preview)\[bot\]$
- check-success='lint (1.15.x, ubuntu-latest)'
- check-success='lint (1.16.x, ubuntu-latest)'
- check-success='lint (1.15.x, macos-latest)'
- check-success='lint (1.16.x, macos-latest)'
- check-success='Analyze (go)'
- -title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
actions:
comment:
message: "⚠️ @theflyingcodr @jadwahab: this is a major version bump and requires your attention"


# ===============================================================================
# AUTOMATIC MERGE (APPROVALS)
# ===============================================================================

- name: Automatic Merge ⬇️ on Approval ✔
conditions:
- "#approved-reviews-by>=1"
- check-success='lint (1.15.x, ubuntu-latest)'
- check-success='lint (1.16.x, ubuntu-latest)'
- check-success='lint (1.15.x, macos-latest)'
- check-success='lint (1.16.x, macos-latest)'
- check-success='Analyze (go)'
- label!=work-in-progress
- -draft
actions:
merge:
method: merge

# ===============================================================================
# AUTHOR
# ===============================================================================

- name: Auto-Assign Author
conditions:
- "#assignee=0"
actions:
assign:
add_users:
- "{{author}}"

# ===============================================================================
# ALERTS
# ===============================================================================

- name: Notify on merge
conditions:
- merged
- label=automerge
actions:
comment:
message: "✅ @{{author}}: **{{title}}** has been merged successfully."
- name: Alert on merge conflict
conditions:
- conflict
- label=automerge
actions:
comment:
message: "🆘 @{{author}}: `{{head}}` has conflicts with `{{base}}` that must be resolved."
label:
add:
- conflict
- name: Alert on tests failure for automerge
conditions:
- label=automerge
- status-failure=commit
actions:
comment:
message: "🆘 @{{author}}: unable to merge due to CI failure."

- name: remove conflict label if not needed
conditions:
- -conflict
actions:
label:
remove:
- conflict

# ===============================================================================
# LABELS
# ===============================================================================
# Automatically add labels when PRs match certain patterns
#
# NOTE:
# - single quotes for regex to avoid accidental escapes
# - Mergify leverages Python regular expressions to match rules.
#
# Semantic commit messages
# - chore: updating grunt tasks etc.; no production code change
# - docs: changes to the documentation
# - feat: feature or story
# - enhancement: an improvement to an existing feature
# - feat: new feature for the user, not a new feature for build script
# - fix: bug fix for the user, not a fix to a build script
# - idea: general idea or suggestion
# - test: test related changes
# ===============================================================================

- name: Hotfix label
conditions:
- "head~=(?i)^hotfix" # if the PR branch starts with hotfix/
actions:
label:
add: ["hot-fix"]
- name: Bug / Fix label
conditions:
- "head~=(?i)^(bug)?fix" # if the PR branch starts with (bug)?fix/
actions:
label:
add: [ "bug-P3" ]
- name: Documentation label
conditions:
- "head~=(?i)^docs" # if the PR branch starts with docs/
actions:
label:
add: [ "documentation" ]
- name: Feature label
conditions:
- "head~=(?i)^feat(ure)?" # if the PR branch starts with feat(ure)?/
actions:
label:
add: ["feature"]
- name: Enhancement label
conditions:
- "head~=(?i)^enhancement?" # if the PR branch starts with enhancement/
actions:
label:
add: ["enhancement"]
- name: Chore label
conditions:
- "head~=(?i)^chore" # if the PR branch starts with chore/
actions:
label:
add: ["update"]
- name: Question label
conditions:
- "head~=(?i)^question" # if the PR branch starts with question/
actions:
label:
add: ["question"]
- name: Test label
conditions:
- "head~=(?i)^test" # if the PR branch starts with test/
actions:
label:
add: ["test"]
- name: Idea label
conditions:
- "head~=(?i)^idea" # if the PR branch starts with idea/
actions:
label:
add: ["idea"]

# ===============================================================================
# STALE BRANCHES
# ===============================================================================

- name: Close stale pull request
conditions:
- base=master
- -closed
- updated-at<21 days ago
actions:
close:
message: |
This pull request looks stale. Feel free to reopen it if you think it's a mistake.
label:
add: [ "stale" ]
# ===============================================================================
# BRANCHES
# ===============================================================================

- name: Delete head branch after merge
conditions:
- merged
actions:
delete_head_branch:

#- name: automatic update for PR marked as “Ready-to-Go“
# conditions:
# - -conflict # skip PRs with conflicts
# - -draft # filter-out GH draft PRs
# - label="Ready-to-Go"
# actions:
# update:

# ===============================================================================
# CONVENTION
# ===============================================================================
# https://www.conventionalcommits.org/en/v1.0.0/
# Premium feature only

#- name: Conventional Commit
# conditions:
# - "title~=^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\\))?:"
# actions:
# post_check:
# title: |
# {% if check_succeed %}
# Title follows Conventional Commit
# {% else %}
# Title does not follow Conventional Commit
# {% endif %}
# summary: |
# {% if not check_succeed %}
# Your pull request title must follow [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/).
# {% endif %}
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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.
name: "CodeQL"

on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 23 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['go']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# 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
12 changes: 12 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Greetings

on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: 'Congrats, you just opened your first pull request on libsv/go-bc! Thank you for contributing!'
Loading

0 comments on commit 48281ce

Please sign in to comment.