This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
archive the repo #68
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: | |
- main | |
- release-* | |
pull_request: {} | |
workflow_dispatch: {} | |
env: | |
GO_VERSION: '1.16' | |
KIND_VERSION: 'v0.10.0' | |
jobs: | |
check-license: | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Run Check License | |
run: hack/make-rules/check_license.sh | |
golangci-lint: | |
runs-on: ubuntu-18.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 | |
run: make lint | |
markdownlint-misspell-shellcheck: | |
runs-on: ubuntu-18.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 .github | xargs mdl -r ~MD010,~MD013,~MD022,~MD024,~MD029,~MD031,~MD032,~MD033,~MD034,~MD036 | |
unit-tests: | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Checkout | |
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: Setup Kind Cluster | |
uses: engineerd/[email protected] | |
with: | |
version: ${{ env.KIND_VERSION }} | |
- name: Install KubeBuilder | |
uses: RyanSiu1995/[email protected] | |
with: | |
version: 3.1.0 | |
kubebuilderOnly: false | |
kubernetesVersion: v1.21.2 | |
- 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 | |
build-binaries: | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Checkout | |
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 all |