Merge pull request #429 from ianrwhitney/change-youtube-link #1028
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Meshery Consul Code Quality | |
on: | |
push: | |
branches: [ master ] # keep it simple and reduce the abuse of CI resources | |
pull_request: | |
branches: [ master ] | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
cache: true | |
cache-dependency-path: go.sum | |
- uses: actions/checkout@master | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
- name: Run golangci-lint | |
run: make lint | |
tidy: | |
name: Go mod tidy | |
needs: [lint] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
cache: true | |
cache-dependency-path: go.sum | |
- uses: actions/checkout@master | |
- name: tidy | |
run: make tidy | |
codecov: | |
# golandci-lint need to be run before codecov and succeed | |
needs: [tidy] | |
name: Code Coverage | |
if: github.repository == 'meshery/meshery-consul' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
cache: true | |
cache-dependency-path: go.sum | |
- name: Run unit tests | |
run: go test --short ./... -race -coverprofile=coverage.txt -covermode=atomic | |
- name: Upload coverage to Codecov | |
if: github.repository == 'meshery/meshery-consul' | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage.txt | |
flags: unittests | |
build: | |
name: Build check | |
runs-on: ubuntu-latest | |
needs: [codecov] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 1 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
cache: true | |
cache-dependency-path: go.sum | |
- run: make gobuild |