forked from ChainSafe/ChainBridge
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from vedhavyas/feat/upgrade
- Loading branch information
Showing
171 changed files
with
8,900 additions
and
6,629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2020 ChainSafe Systems | ||
# SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
|
||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Copyright 2020 ChainSafe Systems | ||
# SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
test: | ||
name: Tests | ||
strategy: | ||
matrix: | ||
go-version: [1.15.x] | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- uses: actions/cache@v2.1.4 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Install Subkey | ||
run: | | ||
wget -P $HOME/.local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-rc6 | ||
mv $HOME/.local/bin/subkey-rc6 $HOME/.local/bin/subkey | ||
chmod +x $HOME/.local/bin/subkey | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Test | ||
run: | | ||
docker-compose -f ./docker-compose-e2e.yml up -d | ||
sleep 3 | ||
docker ps | ||
make test | ||
e2e: | ||
name: E2E Tests | ||
strategy: | ||
matrix: | ||
go-version: [ 1.15.x ] | ||
platform: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- uses: actions/cache@v2.1.4 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Install Subkey | ||
run: | | ||
wget -P $HOME/.local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-rc6 | ||
mv $HOME/.local/bin/subkey-rc6 $HOME/.local/bin/subkey | ||
chmod +x $HOME/.local/bin/subkey | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Test | ||
run: | | ||
docker-compose -f ./docker-compose-e2e.yml up -d | ||
docker ps | ||
make test-e2e | ||
lint: | ||
name: Lint and License Headers | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.36 | ||
args: --timeout=5m | ||
- name: License Check | ||
run: make license-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright 2020 ChainSafe Systems | ||
# SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
name: Docker build and push | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*.*.*" | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
build-and-deploy: | ||
name: Docker Deployment | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' || contains(github.ref, '/tags/v') | ||
steps: | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=chainsafe/chainbridge | ||
VERSION=edge | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
fi | ||
if [ "${{ github.event_name }}" = "schedule" ]; then | ||
VERSION=nightly | ||
fi | ||
TAGS="${DOCKER_IMAGE}:${VERSION}" | ||
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | ||
TAGS="$TAGS,${DOCKER_IMAGE}:latest" | ||
fi | ||
echo ::set-output name=tags::${TAGS} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.prep.outputs.tags }} | ||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2020 ChainSafe Systems | ||
# SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
FROM golang:1.13-stretch AS builder | ||
ADD . /src | ||
WORKDIR /src | ||
RUN go mod download | ||
RUN cd cmd/chainbridge && go build -o /bridge . | ||
|
||
# # final stage | ||
FROM debian:stretch-slim | ||
RUN apt-get -y update && apt-get -y upgrade && apt-get install ca-certificates wget -y | ||
RUN wget -P /usr/local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-rc6 \ | ||
&& mv /usr/local/bin/subkey-rc6 /usr/local/bin/subkey \ | ||
&& chmod +x /usr/local/bin/subkey | ||
RUN subkey --version | ||
|
||
COPY --from=builder /bridge ./ | ||
RUN chmod +x ./bridge | ||
|
||
ENTRYPOINT ["./bridge"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.