Update build.yml

This commit is contained in:
Justin Hammond 2021-09-23 17:20:38 +08:00 committed by GitHub
parent cae24add56
commit 6be98f8be9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,9 +26,28 @@ jobs:
- name: Run tests
run: go test -v -race ./...
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: go
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
codecov:
runs-on: ubuntu-latest
needs: test
needs: [ test, analyze ]
steps:
- name: Install Go
if: success()
@ -45,7 +64,7 @@ jobs:
lint:
name: Lint project using GolangCI Lint
runs-on: ubuntu-latest
needs: test
needs: [ test, analyze ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
@ -56,32 +75,9 @@ jobs:
only-new-issues: true
args: --issues-exit-code=0
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
goreadme:
runs-on: ubuntu-latest
needs: [codecov, lint, analyze]
needs: [codecov, lint]
steps:
- name: Check out repository
uses: actions/checkout@v2
@ -94,6 +90,7 @@ jobs:
title: 'Go-LogAdapter'
# Optional: Token allows goreadme to comment the PR with diff preview.
github-token: '${{ secrets.GITHUB_TOKEN }}'
release:
#if: startsWith(github.ref, 'refs/tags/')
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}