Skip to content

CI (app)

CI (app) #374

Workflow file for this run

name: CI (app)
on:
pull_request:
paths-ignore:
- 'chart/**'
schedule:
- cron: '0 8 * * *'
permissions:
contents: read
actions: read
checks: write
jobs:
golangci-lint:
name: Go lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54
# Optional: working directory, useful for monorepos
# working-directory: somedir
# Optional: golangci-lint command line arguments.
#
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0
args: --timeout=30m --out-format=junit-xml:lint-report.xml,github-actions
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
# Optional: if set to true, then all caching functionality will be completely disabled,
# takes precedence over all other caching options.
# skip-cache: true
# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
# skip-pkg-cache: true
# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
# skip-build-cache: true
# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"
- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: golangci-lint-test-results
path: lint-report.xml
# - name: Test report
# uses: dorny/test-reporter@v1.7.0
# if: success() || failure() # run this step even if previous step failed
# with:
# name: golangci-lint
# path: 'lint-report.xml'
# reporter: java-junit
# fail-on-error: 'false'
test:
name: Go Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: stable
- name: Run Tests
run: |
go test -race -v -coverprofile=coverage.txt -covermode=atomic ./...
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build:
name: Go build
runs-on: ubuntu-latest
needs: [golangci-lint, test]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: stable
- name: Basic build of the project
run: |
go build .