mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
127 lines
No EOL
3.8 KiB
YAML
127 lines
No EOL
3.8 KiB
YAML
name: geth unit tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'debank'
|
|
pull_request:
|
|
branches:
|
|
- 'debank'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
TEMP_ARTIFACT_NAME: geth
|
|
BUILT_BINARY_PATH: build/bin
|
|
BUILT_BINARY_NAME: geth
|
|
OSS_ARCHIVE_FILE_NAME: eth-latest-linux-amd64
|
|
OSS_ARCHIVE_BUCKET: debank-artifacts
|
|
OSS_ARCHIVE_FILE_PREFIX: downloads
|
|
OSS_DOMESTIC_ENDPOINT: oss-cn-hangzhou.aliyuncs.com
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: ./
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16.x
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Configure git for private modules
|
|
run: |
|
|
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/DeBankDeFi".insteadOf "https://github.com/DeBankDeFi"
|
|
|
|
- name: Golangci-lint
|
|
uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
version: v1.42.1
|
|
only-new-issues: true
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: lint
|
|
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16.x
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
~/.cache/go-build
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Make binaries
|
|
run: |
|
|
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/DeBankDeFi".insteadOf "https://github.com/DeBankDeFi"
|
|
make geth
|
|
|
|
- name: Archive built binaries
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ env.TEMP_ARTIFACT_NAME }}
|
|
path: ${{ env.BUILT_BINARY_PATH }}/${{ env.BUILT_BINARY_NAME }}
|
|
retention-days: 1
|
|
|
|
package:
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
|
- name: Download built binaries
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: ${{ env.TEMP_ARTIFACT_NAME }}
|
|
path: ${{ env.BUILT_BINARY_PATH }}
|
|
|
|
- name: Archive artifacts
|
|
run: |
|
|
mkdir $OSS_ARCHIVE_FILE_NAME
|
|
cp $BUILT_BINARY_PATH/$BUILT_BINARY_NAME $OSS_ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME
|
|
sha256sum $OSS_ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME --tag >> $OSS_ARCHIVE_FILE_NAME/sha256.checksum
|
|
chmod u+x $OSS_ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME
|
|
$OSS_ARCHIVE_FILE_NAME/$BUILT_BINARY_NAME version
|
|
tar cvfz $OSS_ARCHIVE_FILE_NAME.tar.gz $OSS_ARCHIVE_FILE_NAME
|
|
|
|
- name: Setup aliyun oss
|
|
uses: barryz/setup-ossutil@master
|
|
with:
|
|
endpoint: ${{ env.OSS_DOMESTIC_ENDPOINT }}
|
|
access-key-id: ${{ secrets.OSS_KEY_ID }}
|
|
access-key-secret: ${{ secrets.OSS_KEY_SECRET }}
|
|
|
|
- name: Copy artifacts to oss
|
|
run: |
|
|
ossutil cp -rf $OSS_ARCHIVE_FILE_NAME.tar.gz oss://$OSS_ARCHIVE_BUCKET/$OSS_ARCHIVE_FILE_PREFIX/$OSS_ARCHIVE_FILE_NAME.tar.gz
|
|
ossutil set-acl oss://$OSS_ARCHIVE_BUCKET/$OSS_ARCHIVE_FILE_PREFIX/$OSS_ARCHIVE_FILE_NAME.tar.gz public-read
|
|
|
|
- name: comment PR
|
|
uses: unsplash/comment-on-pr@master
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
msg: "Artifacts uploaded, click or copy [this link](https://${{ env.OSS_ARCHIVE_BUCKET }}.${{ env.OSS_DOMESTIC_ENDPOINT }}/${{ env.OSS_ARCHIVE_FILE_PREFIX }}/${{ env.OSS_ARCHIVE_FILE_NAME }}.tar.gz) to download. :tada:"
|
|
check_for_duplicate_msg: true
|
|
continue-on-error: true |