From 98be522bbcce6b571e6a4945e92eeec39b2c66be Mon Sep 17 00:00:00 2001 From: barryz Date: Tue, 7 Sep 2021 16:09:25 +0800 Subject: [PATCH] ci: separate lint and release workflow --- .github/workflows/lint.yml | 36 +++++++++++++++++++++++ .github/workflows/{ci.yml => release.yml} | 35 +--------------------- 2 files changed, 37 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/lint.yml rename .github/workflows/{ci.yml => release.yml} (80%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..524f07016f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +name: "Linters for Pull Request" + +on: + pull_request: + branches: + - 'debank' + workflow_dispatch: + +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 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/release.yml similarity index 80% rename from .github/workflows/ci.yml rename to .github/workflows/release.yml index e502c49276..d321fe63c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: geth unit tests +name: "Release new artifacts" on: push: @@ -18,40 +18,9 @@ env: 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 @@ -86,9 +55,7 @@ jobs: package: runs-on: ubuntu-latest - needs: build - steps: - name: Download built binaries uses: actions/download-artifact@v2