ci(lint): add commits linter for pr check #93
This file contains hidden or 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: Pre-Check | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| lint-vendor-build: | |
| name: Lint & Vendor & Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build Docker Image (only for lint-vendor-build) | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: ./Dockerfile.devel | |
| push: false | |
| load: true | |
| tags: huatuo-dev:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Do Lint & Check Vendor,Build | |
| run: | | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/workspace \ | |
| -w /workspace \ | |
| huatuo-dev:latest \ | |
| sh -c "git config --global --add safe.directory /workspace \ | |
| && make gen && make --trace check \ | |
| && make vendor && git diff --exit-code \ | |
| && make build" |