Bump golang.org/x/mod from 0.14.0 to 0.22.0 #3139
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: Go | |
on: | |
pull_request: | |
branches: | |
- main | |
- release-* | |
- feature/* | |
push: | |
branches: | |
- main | |
- release-* | |
- feature/* | |
jobs: | |
check-changes: | |
name: Check whether tests need to be run based on diff | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: antrea-io/has-changes@v2 | |
id: check_diff | |
with: | |
paths-ignore: docs/* ci/jenkins/* *.md hack/.notableofcontents | |
outputs: | |
has_changes: ${{ steps.check_diff.outputs.has_changes }} | |
test-unit: | |
needs: check-changes | |
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} | |
name: Unit test | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Set up Go using version from go.mod | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Run unit tests | |
run: make test-unit | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: .coverage/unit/coverage-unit.txt | |
flags: unit-tests | |
name: codecov-unit-test | |
check-snowflake-changes: | |
name: Check whether snowflake tests need to be run based on diff | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: antrea-io/has-changes@v2 | |
id: check_diff | |
with: | |
paths: snowflake/* | |
outputs: | |
has_changes: ${{ steps.check_diff.outputs.has_changes }} | |
test-unit-snowflake: | |
needs: check-snowflake-changes | |
if: ${{ needs.check-snowflake-changes.outputs.has_changes == 'yes' }} | |
name: Unit test snowflake | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Set up Go using version from go.mod | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'snowflake/go.mod' | |
cache-dependency-path: 'snowflake/go.sum' | |
- name: Run unit tests | |
run: | | |
cd snowflake | |
make test-unit | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: snowflake/.coverage/coverage-unit.txt | |
flags: unit-tests | |
name: codecov-unit-test-snowflake | |
golangci-lint: | |
needs: check-changes | |
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} | |
name: Golangci-lint | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Set up Go using version from go.mod | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache-dependency-path: '**/go.sum' | |
- name: Run golangci-lint | |
run: make golangci | |
snowflake-golangci-lint: | |
needs: check-changes | |
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} | |
name: Snowflake-golangci-lint | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Set up Go using version from go.mod | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'snowflake/go.mod' | |
cache-dependency-path: '**/snowflake/go.sum' | |
- name: Run snowflake golangci-lint | |
run: cd snowflake ; make golangci | |
tidy-manifest: | |
needs: check-changes | |
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} | |
name: Check tidy and manifest | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Set up Go using version from go.mod | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache-dependency-path: '**/go.sum' | |
- name: Check tidy | |
run: make test-tidy | |
- name: Check manifest | |
run: ./ci/check-manifest.sh | |
- name: Check copyright | |
run: ./ci/check-copyright.sh | |
tidy-snowflake-tidy: | |
needs: check-changes | |
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} | |
name: Check tidy and manifest | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Set up Go using version from go.mod | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache-dependency-path: '**/go.sum' | |
- name: Check tidy for Snowflake | |
run: cd snowflake; make test-tidy | |
verify: | |
name: Verify docs and spelling | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Check-out code | |
uses: actions/checkout@v4 | |
- name: Set up Go using version from go.mod | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache-dependency-path: '**/go.sum' | |
- name: Run verify scripts | |
run: make verify | |
- name: Checking for broken Markdown links | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
with: | |
# Check modified files only for pull requests. Cronjob "Verify docs" takes care of checking all markdown files. | |
check-modified-files-only: yes | |
base-branch: ${{ github.base_ref }} | |
config-file: 'hack/.md_links_config.json' | |
- name: Markdownlint | |
run: | | |
sudo npm install -g [email protected] | |
make markdownlint | |
- name: Checking whether autogenerated Helm chart documentation is up-to-date | |
working-directory: build/charts/ | |
run: | | |
make helm-docs | |
DIFF=$(git diff .) | |
if [ -n "$DIFF" ]; then | |
echo "The Helm chart documentation is out-of-date; please run 'make helm-docs' in 'build/charts/' and commit the changes" | |
exit 1 | |
fi |