-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update github workflows, linters, configs, docs and readme
Signed-off-by: Pranay Valson <[email protected]>
- Loading branch information
Showing
21 changed files
with
966 additions
and
22 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,43 @@ | ||
name: build-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "develop" | ||
|
||
jobs: | ||
audit: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.22.5 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Verify dependencies | ||
run: go mod verify | ||
|
||
- name: Build all | ||
run: make all | ||
|
||
- name: Run tests | ||
run: make test | ||
|
||
- name: Upload coverage to Codecov | ||
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Clean | ||
run: make clean |
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,46 @@ | ||
name: docker-image-ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "develop" | ||
|
||
jobs: | ||
push-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to GitHub Container Registry | ||
if: ${{ !env.ACT }} | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.CR_USER }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Build & Publish the Docker image | ||
if: ${{ !env.ACT }} | ||
run: | | ||
docker build . --file Dockerfile --tag ghcr.io/covalenthq/bsp-geth:latest | ||
docker push ghcr.io/covalenthq/bsp-geth:latest | ||
# - name: Start containers | ||
# run: docker-compose -f "docker-compose.yml" up --build --remove-orphans --force-recreate --exit-code-from agent | ||
|
||
# - name: Check running bsp-geth | ||
# run: docker inspect bsp-geth | ||
|
||
# - name: Check running containers | ||
# run: docker ps | ||
|
||
# - name: Stop containers | ||
# if: always() | ||
# run: docker-compose -f "docker-compose.yml" down |
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,31 @@ | ||
name: gcr-image | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "develop" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to GCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: us-docker.pkg.dev | ||
username: _json_key | ||
password: ${{ secrets.GCR_JSON_KEY }} | ||
|
||
- uses: actions/checkout@v2 | ||
# - uses: satackey/[email protected] | ||
- name: Build & Publish the Docker image | ||
run: | | ||
docker buildx create --name builder --use --platform=linux/amd64,linux/arm64 && docker buildx build --platform=linux/amd64,linux/arm64 . -t us-docker.pkg.dev/covalent-project/network/bsp-geth:latest --push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: golangci-lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "develop" | ||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
# pull-requests: read | ||
jobs: | ||
golangci-build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
- name: Set up Go 1.22.5 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.22.5 | ||
id: go | ||
- run: go version | ||
|
||
- name: Lint | ||
run: | | ||
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2 | ||
# ./bin/golangci-lint run | ||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
# Optional: golangci-lint command line arguments. | ||
# args: --issues-exit-code=0 | ||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
# Optional: if set to true then the action will use pre-installed Go. | ||
# skip-go-installation: true | ||
# Optional: if set to true then the action don't cache or restore ~/go/pkg. | ||
# skip-pkg-cache: true | ||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | ||
# skip-build-cache: true |
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 @@ | ||
name: dockerfile-lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "develop" | ||
|
||
jobs: | ||
linter: | ||
name: lint-dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: lint dockerfile | ||
uses: brpaz/hadolint-action@master | ||
with: | ||
dockerfile: "Dockerfile" |
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,39 @@ | ||
name: tag-release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
tagged-release: | ||
name: Tagged Release | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: Login to GCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: us-docker.pkg.dev | ||
username: _json_key | ||
password: ${{ secrets.GCR_JSON_KEY }} | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
# - uses: satackey/[email protected] | ||
|
||
- name: Set env | ||
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
|
||
- name: Build & Publish the Docker image | ||
run: | | ||
docker buildx create --name builder --use --platform=linux/amd64,linux/arm64 && docker buildx build --platform=linux/amd64,linux/arm64 . -t us-docker.pkg.dev/covalent-project/network/bsp-geth:stable -t us-docker.pkg.dev/covalent-project/network/bsp-geth:"${{ env.TAG }}" --push | ||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
draft: false | ||
prerelease: false | ||
files: | | ||
*.zip | ||
*.tar.gz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ignored: | ||
- DL3018 | ||
- DL3016 | ||
- DL3059 |
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.