Skip to content

Commit

Permalink
chore: Initial setup (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 committed Oct 19, 2023
1 parent b4dd1b9 commit eb0acb4
Show file tree
Hide file tree
Showing 20 changed files with 636 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers
* @P1sar @mpetrun5 @tcar121293 @MakMuftic @nmlinaric @freddyli7
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/backlog-item.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Backlog item
about: Speccing out the details of development for specific features/epics
title: ''
labels: ''
assignees: ''

---

<!--- Provide a general summary of the issue in the Title above -->

## Implementation details
<!-- Enter description of implementation that may help dev team -->

## Testing details
<!-- Enter description of special test-cases-->

## Acceptance Criteria
<!-- Enter the conditions of satisfaction here. That is, the conditions that will satisfy the user/persona that the goal/benefit/value has been achieved -->
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

<!--- Provide a general summary of the issue in the Title above -->

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Versions
Sygma commit (or docker tag):
chainbride-solidity version:
Go version:
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/user-sotry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: User story
about: Piece of system functionality, understood by the Customer / Product Owner, representing an increment of business value, to be implemented by the team.
title: ''
labels: ''
assignees: ''

---

## Story
As a <type of user/persona>
I want <to perform some task>
So that I can <achieve some goal/benefit/value>

## Background
<!-- Enter any details that may help to get into context of this task -->

## Details
<!-- Enter any details, clarifications, answers to questions, or points about implementation here -->

## Scenarios
Scenario: <name of scenario>
Given I am <type of user/persona>
When <process any kind of action>
And <additional optional action>
Then <result>

## Implementation details
<!-- Enter description of implementation that may help dev team -->

## Testing details
<!-- Enter description of special test-cases-->

## Acceptance criteria
<!-- Enter the conditions of satisfaction here. That is, the conditions that will satisfy the user/persona that the goal/benefit/value has been achieved -->
32 changes: 32 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Related Issue Or Context
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Otherwise, describe context and motivation for change herre -->

Closes: #<issue>

## How Has This Been Tested? Testing details.
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have ensured that all acceptance criteria (or expected behavior) from issue are met
- [ ] I have updated the documentation locally and in docs.
- [ ] I have added tests to cover my changes.
- [ ] I have ensured that all the checks are passing and green, I've signed the CLA bot
24 changes: 24 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only

on: [pull_request]
name: Linter check
env:
GO111MODULE: on

jobs:
linter-check:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19

- uses: actions/checkout@v2

- name: Install linter
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin

- name: Run linter
run: golangci-lint run --timeout=10m
45 changes: 45 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only

name: "Code Scanning - Action"

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * 0'

jobs:
CodeQL-Build:
runs-on: ubuntu-latest

permissions:
security-events: write
actions: read
contents: read

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
17 changes: 17 additions & 0 deletions .github/workflows/dependecy-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only

name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
15 changes: 15 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

on: [pull_request]
name: License check
env:
GO111MODULE: on

license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: make license

- name: license updated check
run: git diff --exit-code
24 changes: 24 additions & 0 deletions .github/workflows/mocks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only

on: [pull_request]
name: Mocks check
env:
GO111MODULE: on

jobs:
mocks-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-go@v2
with:
go-version: "^1.17"

- run: go install github.com/golang/mock/mockgen@v1.6.0

- run: make genmocks

- name: mocks updated check
run: git diff --exit-code
21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only

on: [pull_request]
name: "Semantic PR"

jobs:
validation:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
chore
validateSingleCommit: false
validateSingleCommitMatchesPrTitle: false
83 changes: 83 additions & 0 deletions .github/workflows/publish-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only

name: Publish binaries

on:
release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: actions/setup-go@v3
with:
go-version: '1.19'

- name: Build
run: make build-all

- name: Archive Linux 64
uses: thedoctor0/zip-release@master
with:
filename: 'relayer-linux-amd64.zip'
directory: 'build/linux-amd64/'

- name: Archive Linux Arm
uses: thedoctor0/zip-release@master
with:
filename: 'relayer-linux-arm.zip'
directory: 'build/linux-arm/'

- name: Archive Darwin 64
uses: thedoctor0/zip-release@master
with:
filename: 'relayer-darwin-amd64.zip'
directory: 'build/darwin-amd64/'

- name: Archive Darwin Arm 64
uses: thedoctor0/zip-release@master
with:
filename: 'relayer-darwin-arm64.zip'
directory: 'build/darwin-arm64/'

- name: Upload Linux amd64
id: relayer-linux-amd64
uses: AButler/upload-release-assets@v2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
files: 'build/linux-amd64/relayer-linux-amd64.zip'

- name: Upload Linux arm
id: relayer-linux-arm
uses: AButler/upload-release-assets@v2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
files: 'build/linux-arm/relayer-linux-arm.zip'

- name: Upload Darwin amd64
id: relayer-darwin-amd64
uses: AButler/upload-release-assets@v2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
files: 'build/darwin-amd64/relayer-darwin-amd64.zip'

- name: Upload Darwin arm
id: relayer-darwin-arm64
uses: AButler/upload-release-assets@v2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
files: 'build/darwin-arm64/relayer-darwin-arm64.zip'
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# The Licensed Work is (c) 2022 Sygma
# SPDX-License-Identifier: LGPL-3.0-only

name: Create Sygma relayer release

on:
push:
branches:
- main
jobs:
release-please:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:

- uses: actions/checkout@v2
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.RELEASE_TOKEN }}
release-type: go
package-name: release-please-action
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"revert","hidden":true}]'
Loading

0 comments on commit eb0acb4

Please sign in to comment.