From 44e1f7704aa3dd027880a13ef5842466788d8836 Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Sat, 18 Apr 2020 13:40:00 -0700 Subject: [PATCH] Validate go mod on CI --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81c1ee87..786470d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] + steps: - name: Install Go uses: actions/setup-go@v1 @@ -36,16 +37,33 @@ jobs: run: | make test - lint: - name: Lint + checks: + name: Checks runs-on: ubuntu-latest steps: - name: Install Go uses: actions/setup-go@v1 with: go-version: 1.12 + - name: Checkout uses: actions/checkout@v1 + + - name: Go mod + env: + DIFF_PATH: "go.mod go.sum" + run: | + go mod tidy + DIFF=$(git status --porcelain -- $DIFF_PATH) + if [ "$DIFF" ]; then + echo + echo "These files were modified:" + echo + echo "$DIFF" + echo + exit 1 + fi + - name: Lint run: | make lint