Merge pull request #913 from kakao/dependabot/go_modules/go.etcd.io/e… #3049
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 | |
pull_request: | |
env: | |
GO_VERSION: "1.23" | |
PYTHON_VERSION: 3.9 | |
GRPC_HEALTH_PROBE_VERSION: v0.4.13 | |
jobs: | |
gomod: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Install tools | |
run: | | |
make tools | |
- name: Check go mod | |
run: | | |
make mod-tidy-check | |
make mod-vendor-check | |
- name: Check proto | |
run: | | |
make proto-check | |
- name: Check generate | |
run: | | |
make generate-check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6.1.1 | |
with: | |
version: v1.60.1 | |
skip-cache: true | |
skip-pkg-cache: true | |
build: | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Build | |
run: make build | |
test: | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Install grpc_health_probe | |
run: | | |
wget -qO${PWD}/bin/grpc-health-probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${{ env.GRPC_HEALTH_PROBE_VERSION }}/grpc_health_probe-linux-amd64 | |
chmod +x ${PWD}/bin/grpc-health-probe | |
echo "${PWD}/bin" >> $GITHUB_PATH | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install pytest | |
run: | | |
pip install pytest | |
pip install pytest-cov | |
- name: Run unit tests with coverage profiling | |
run: | | |
make test_coverage TEST_FLAGS='-race -failfast -count=1 -timeout=20m' | |
- name: Run end-to-end tests with coverage profiling | |
run: | | |
make test_e2e_local_coverage TEST_FLAGS='-race -failfast -count=1 -timeout=20m' | |
- name: Generate coverage profile | |
run: | | |
make generate_coverage_profile | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4.6.0 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.out,./coverage.xml | |
fail_ci_if_error: true | |
verbose: true |