Create go.yml #1
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: Kmesh CI Workflow | |
on: pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
go-version: [ '1.22' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4.0.0 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Run gen-check | |
run: | | |
make gen-check | |
- name: Build Kmesh | |
shell: bash | |
run: | | |
sudo env "PATH=$PATH" bash ./build.sh | |
- name: Setup Enviroments | |
run: | | |
echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/mk" >> $GITHUB_ENV | | |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/out/amd64" >> $GITHUB_ENV | |
# Since requiring code generated by the Proto compilation, execute go lint after building. | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3.7.0 | |
with: | |
args: "--config=common/config/.golangci.yaml --out-format colored-line-number" | |
skip-pkg-cache: true | |
- name: Go Test | |
run: sudo go test -v -vet=off ./pkg/... | |