diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 000000000..6fd0e4fbd --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,56 @@ +name: Run checks + +on: + push: + pull_request: + +jobs: + check-format: + runs-on: ubuntu-latest + if: | + github.event_name == 'push' || + github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name != github.repository + + steps: + - uses: actions/checkout@master + + - name: Check format + run: | + gofmt -d -e -s . + if [ "$(gofmt -l -s . | wc -l)" -gt 0 ]; then exit 1; fi + + luacheck: + runs-on: ubuntu-latest + if: | + github.event_name == 'push' || + github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name != github.repository + steps: + - uses: actions/checkout@master + + - name: Setup Tarantool + uses: tarantool/setup-tarantool@v1 + with: + tarantool-version: '2.8' + + - name: Setup luacheck + run: tarantoolctl rocks install luacheck 0.25.0 + + - name: Run luacheck + run: ./.rocks/bin/luacheck . + + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v2 + + - uses: actions/checkout@v2 + + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Show only new issues if it's a pull request. + only-new-issues: true + args: --issues-exit-code=0