2020-11-24 16:12:39 +08:00
|
|
|
name: Code Checker
|
|
|
|
# TODO: do not trigger action for some document file update
|
|
|
|
|
|
|
|
# This workflow is triggered on pushes or pull request to the repository.
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
|
|
|
- 'scripts/**'
|
|
|
|
- 'internal/**'
|
|
|
|
- 'cmd/**'
|
|
|
|
- 'build/**'
|
|
|
|
- '.github/workflows/code-checker.yaml'
|
|
|
|
- '.env'
|
|
|
|
- docker-compose.yml
|
|
|
|
- Makefile
|
|
|
|
- '!**.md'
|
2021-05-14 18:23:30 +08:00
|
|
|
- '!build/ci/jenkins/**'
|
2021-09-29 23:28:55 +08:00
|
|
|
# FIXME(wxyu): not need to run code check, update the ci-passed rules and remove these two lines
|
|
|
|
- go.mod
|
|
|
|
- go.sum
|
2020-11-24 16:12:39 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
ubuntu:
|
2021-04-29 10:19:41 +08:00
|
|
|
name: Code Checker AMD64 Ubuntu ${{ matrix.ubuntu }}
|
2021-12-21 11:34:54 +08:00
|
|
|
runs-on: ubuntu-${{ matrix.ubuntu }}
|
2020-11-24 16:12:39 +08:00
|
|
|
timeout-minutes: 60
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
ubuntu: [18.04]
|
|
|
|
env:
|
|
|
|
UBUNTU: ${{ matrix.ubuntu }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-12-09 20:07:27 +08:00
|
|
|
- name: Cache CCache Volumes
|
2020-11-24 17:04:48 +08:00
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
2020-12-09 20:07:27 +08:00
|
|
|
path: .docker/amd64-ubuntu${{ matrix.ubuntu }}-ccache
|
|
|
|
key: ubuntu${{ matrix.ubuntu }}-ccache-${{ hashFiles('internal/core/**') }}
|
|
|
|
restore-keys: ubuntu${{ matrix.ubuntu }}-ccache-
|
|
|
|
- name: Cache Go Mod Volumes
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: .docker/amd64-ubuntu${{ matrix.ubuntu }}-go-mod
|
|
|
|
key: ubuntu${{ matrix.ubuntu }}-go-mod-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: ubuntu${{ matrix.ubuntu }}-go-mod-
|
2020-11-24 16:12:39 +08:00
|
|
|
- name: Code Check
|
2020-12-09 20:07:27 +08:00
|
|
|
env:
|
|
|
|
CHECK_BUILDER: "1"
|
2020-11-24 16:12:39 +08:00
|
|
|
run: |
|
|
|
|
./build/builder.sh /bin/bash -c "make check-proto-product && make verifiers"
|