From d8fe670b53d9ec36c44a57225e58e85ff65dd48e Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Mon, 24 Aug 2020 16:09:51 +0800 Subject: [PATCH] Refine & format --- .github/workflows/coverage.yml | 13 ++++-------- .github/workflows/dlc.yml | 36 +++++++++++++++------------------- .github/workflows/docker.yaml | 4 ++-- .github/workflows/linter.yml | 12 +++++------- .github/workflows/sign.yml | 31 +++++++++-------------------- .github/workflows/stale.yml | 16 +++++++-------- .github/workflows/test.yml | 13 ++++-------- 7 files changed, 47 insertions(+), 78 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b3c84f102..dd909e69f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -2,30 +2,25 @@ name: Coverage on: push: - branches: [ master ] + branches: [master] jobs: - - build: - name: Coverage + coverage: runs-on: ubuntu-latest - steps: - - name: Set up Go 1.x uses: actions/setup-go@v2 with: go-version: ^1.14 - id: go - - name: Check out code into the Go module directory + - name: Checkout default branch uses: actions/checkout@v2 - name: Get dependencies run: | go get -v -t -d ./... - - name: Run Coverage + - name: Run coverage run: ./testing/coverage/coverall2 - name: Upload coverage to Codecov diff --git a/.github/workflows/dlc.yml b/.github/workflows/dlc.yml index bc8158d4d..0fb5c8548 100644 --- a/.github/workflows/dlc.yml +++ b/.github/workflows/dlc.yml @@ -1,28 +1,24 @@ -name: Update dlc +name: Update Geofiles on: schedule: - - cron: '0 0 * * FRI' + - cron: "0 0 * * FRI" jobs: - - build: - name: Update + update: runs-on: ubuntu-latest steps: - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + - name: Checkout default branch + uses: actions/checkout@v2 - - name: Download and Write - run: | - curl -L -o release/config/geoip.dat "https://github.com/v2fly/geoip/raw/release/geoip.dat" - curl -L -o release/config/geosite.dat "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat" - - - name: push - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am "update geoip, geosite" -a - git push -v --progress - + - name: Download + run: | + curl -L -o release/config/geoip.dat "https://github.com/v2fly/geoip/raw/release/geoip.dat" + curl -L -o release/config/geosite.dat "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat" + + - name: push + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -am "update geoip, geosite" + git push -v --progress diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 73bacb262..47326cb2e 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -9,7 +9,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - name: Set up Checkout + - name: Checkout default branch uses: actions/checkout@v2 - name: Install Buildx and QEMU @@ -21,7 +21,7 @@ jobs: docker run --rm --privileged multiarch/qemu-user-static:latest --reset -p yes --credential yes docker buildx create --use --name build --node build --driver-opt network=host - - name: Log in to Docker Hub + - name: Login to Docker Hub env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 20592df1a..f81ca542d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -2,21 +2,19 @@ name: Lint Code Base on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] types: [assigned, opened, synchronize, reopened] jobs: - build: - name: Lint Code Base + lint: runs-on: ubuntu-latest - steps: - - name: Checkout Code + - name: Checkout default branch uses: actions/checkout@v2 - - name: Lint Code Base + - name: Lint Codebase uses: github/super-linter@v2.2.0 env: VALIDATE_ALL_CODEBASE: false diff --git a/.github/workflows/sign.yml b/.github/workflows/sign.yml index 24c32d677..4dcdbfb68 100644 --- a/.github/workflows/sign.yml +++ b/.github/workflows/sign.yml @@ -1,37 +1,24 @@ -# This is a basic workflow to help you get started with Actions - name: Sign -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: release: types: [released] -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + sign: runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - name: Checkout default branch + uses: actions/checkout@v2 - # Invoke release signing - - name: make it run - run: chmod +x $GITHUB_WORKSPACE/release/requestsign_github.sh + - name: Grant it execution permission + run: | + chmod +x $GITHUB_WORKSPACE/release/requestsign_github.sh + chmod +x $GITHUB_WORKSPACE/release/requestsign.sh - # Invoke release signing - - name: make it run - run: chmod +x $GITHUB_WORKSPACE/release/requestsign.sh - - # Invoke release signing - name: Invoke release signing env: SIGN_SERVICE_PASSWORD: ${{ secrets.SIGN_SERVICE_PASSWORD }} SIGN_SERIVCE_URL: ${{ secrets.SIGN_SERIVCE_URL }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: $GITHUB_WORKSPACE/release/requestsign_github.sh \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: $GITHUB_WORKSPACE/release/requestsign_github.sh diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5863f3dfc..cbc836e29 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,17 +2,15 @@ name: Mark stale issues and pull requests on: schedule: - - cron: "30 1 * * *" + - cron: "30 1 * * *" jobs: stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days' - days-before-stale: 120 - days-before-close: 5 + - uses: actions/stale@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: "This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days" + days-before-stale: 120 + days-before-close: 5 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbc4c6568..1fd239cc2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,28 +2,23 @@ name: Test on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: - - build: - name: Test + test: runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - steps: - - name: Set up Go 1.x uses: actions/setup-go@v2 with: go-version: ^1.14 - id: go - - name: Check out code into the Go module directory + - name: Checkout default branch uses: actions/checkout@v2 - name: Get dependencies