Skip to content

Implement a run-schedule command #759

Implement a run-schedule command

Implement a run-schedule command #759

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
paths-ignore:
- 'docs/**'
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- 'docs/**'
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
go_version: ['1.21']
os: [ubuntu-latest, windows-latest, macos-latest]
env:
OS: ${{ matrix.os }}
GO: ${{ matrix.go_version }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go_version }}
check-latest: true
cache: true
- name: Build
run: make build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: "go test -v -race -short -coverprofile='coverage.out' ./..."
shell: bash
- name: Code coverage with codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,GO
file: ./coverage.out
flags: unittests
fail_ci_if_error: false
verbose: true
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report-${{ matrix.os }}
path: coverage.out
sonarCloudTrigger:
needs: build
name: SonarCloud Trigger
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Download code coverage results
uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}