Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

archive the yurt-edgex-manager repo (#108) #194

archive the yurt-edgex-manager repo (#108)

archive the yurt-edgex-manager repo (#108) #194

Workflow file for this run

name: CI
on:
push:
pull_request:
branches: [ main ]
env:
# Common versions
GO_VERSION: '1.18'
GOLANGCI_VERSION: 'v1.45'
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Lint golang code
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_VERSION }}
args: --disable-all -E deadcode -E gofmt -E goimports -E ineffassign -E misspell -E vet --timeout=15m
markdownlint-misspell-shellcheck:
runs-on: ubuntu-latest
# this image is build from Dockerfile
# https://github.com/pouchcontainer/pouchlinter/blob/master/Dockerfile
container: pouchcontainer/pouchlinter:v0.1.2
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run misspell
run: find ./* -name "*" | xargs misspell -error
- name: Lint markdown files
run: find ./ -name "*.md" | grep -v enhancements | grep -v .github | xargs mdl -r ~MD010,~MD013,~MD014,~MD022,~MD024,~MD029,~MD031,~MD032,~MD033,~MD034,~MD036
UnitTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Fetch History
run: git fetch --prune --unshallow
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Run test
run: make test
- name: Upload test coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cover.out
verbose: true
- name: Build All Binaries
run: make build