feat: improve hostNetwork mode of NodePool by adding NodeAffinity to … #18
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: | |
GO_VERSION: 1.18 | |
# Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run | |
# a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether | |
# credentials have been provided before trying to run steps that need them. | |
DOCKER_USR: ${{ secrets.DOCKER_USR }} | |
AWS_USR: ${{ secrets.AWS_USR }} | |
jobs: | |
verify: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Verify Code | |
run: make verify | |
golangci-lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Lint golang code | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.54 | |
args: -v | |
skip-cache: true | |
markdownlint-misspell-shellcheck: | |
runs-on: ubuntu-22.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@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,~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-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Fetch History | |
run: git fetch --prune --unshallow | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Cache Go Dependencies | |
uses: actions/cache@v3 | |
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 | |
# only publish result in openyurt repo | |
if: github.repository == 'openyurtio/openyurt' | |
uses: codecov/codecov-action@v3 | |
with: | |
name: codecov-umbrella | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unittests | |
files: ./cover.out,./yurttunnel-cover.out | |
fail_ci_if_error: true | |
verbose: true | |
e2e-tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: Install Required Commands | |
run: | | |
go get sigs.k8s.io/[email protected] | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.3/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl | |
- name: Build Images | |
run: make docker-build | |
- name: Local Up Openyurt Cluster With Kind | |
run: NODES_NUM=3 DISABLE_DEFAULT_CNI=true make local-up-openyurt | |
- name: Run e2e Tests | |
run: make e2e-tests |