This repository has been archived by the owner on Nov 2, 2023. It is now read-only.
archive yurt-app-manager #189
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: CI | |
on: | |
push: | |
branches: | |
- master | |
- release-* | |
pull_request: {} | |
workflow_dispatch: {} | |
env: | |
# Common versions | |
GO_VERSION: '1.16' | |
GOLANGCI_VERSION: 'v1.42.1' | |
DOCKER_BUILDX_VERSION: 'v0.4.2' | |
jobs: | |
verify: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Verify Code | |
run: make verify | |
golangci-lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Lint golang code | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: ${{ env.GOLANGCI_VERSION }} | |
args: -v | |
markdownlint-misspell-shellcheck: | |
runs-on: ubuntu-20.04 | |
# 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@v2 | |
- 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 | |
# - name: Check markdown links | |
# run: | | |
# set +e | |
# for name in $(find . -name \*.md | grep -v CHANGELOG); do | |
# if [ -f $name ]; then | |
# markdown-link-check -q $name -c .github/workflows/markdown-link-check.config.json; | |
# if [ $? -ne 0 ]; then | |
# code=1 | |
# fi | |
# fi | |
# done | |
# bash -c "exit $code"; | |
unit-tests: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Fetch History | |
run: git fetch --prune --unshallow | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
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 Unit Tests | |
run: make test | |
- name: Publish Unit Test Coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
name: codecov-umbrella | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unittests | |
files: ./cover.out | |
fail_ci_if_error: true | |
verbose: true | |
build-binaries: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Fetch History | |
run: git fetch --prune --unshallow | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
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: Build All Binaries | |
run: make build |