Skip to content

nbozhkov-ucl/test_go_ci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

02_05 CI for Go

The following workflow updates the workflow suggested by GitHub Actions with the following:

The Updated Workflow

The updated workflow can be found in the code snippet below and in the repo here: ./go-ci-workflow.yml.

name: Go

env:
  GIN_MODE: release

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:
    runs-on: ubuntu-latest

    permissions:
      checks: write

    steps:
    - uses: actions/checkout@v3

    - name: Set up Go
      uses: actions/setup-go@v3
      with:
        go-version-file: 'go.mod'
        cache: true

    - name: Revive Action
      uses: morphy2k/[email protected]

    - name: Staticcheck
      uses: dominikh/[email protected]

    - name: Build
      run: |
        go mod download
        go install gotest.tools/gotestsum@latest

    - name: Test
      run: |
        gotestsum --format=standard-verbose --junitfile=junit.xml

    - name: Publish Test Report
      uses: mikepenz/action-junit-report@v3
      if: success() || failure() # always run even if the previous step fails
      with:
        report_paths: '**/junit.xml'
        detailed_summary: true
        include_passed: true

For more information see the GitHub documentation for Building and testing Go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages