Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
init ci refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Konovalov committed Sep 14, 2024
1 parent c013b51 commit bb765d2
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 24 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Run checks

on:
push:
pull_request:

jobs:
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@v2
with:
tarantool-version: '2.8'

- name: Setup tt
run: |
curl -L https://tarantool.io/release/2/installer.sh | sudo bash
sudo apt install -y tt
tt version
- name: Setup luacheck
run: tt rocks install luacheck 0.25.0

- name: Run luacheck
run: ./.rocks/bin/luacheck .

golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2

- uses: actions/checkout@v2

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
continue-on-error: true
with:
# The first run is for GitHub Actions error format.
args: --config=.golangci.yaml

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# The second run is for human-readable error format with a file name
# and a line number.
args: --out-${NO_FUTURE}format colored-line-number --config=.golangci.yaml
26 changes: 2 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ on:
branches: [ "master" ]

jobs:

test:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -28,25 +27,4 @@ jobs:
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: KaymeKaydex/go-vshard-router

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2

- uses: actions/checkout@v2

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
continue-on-error: true
with:
# The first run is for GitHub Actions error format.
args: --config=.golangci.yaml

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# The second run is for human-readable error format with a file name
# and a line number.
args: --out-${NO_FUTURE}format colored-line-number --config=.golangci.yaml
slug: KaymeKaydex/go-vshard-router
51 changes: 51 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
std = "luajit"
codes = true

read_globals = {
-- Tarantool vars:
"box",
"tonumber64",

"spacer",
"F",
"T",

package = {
fields = {
reload = {
fields = {
"count",
"register",
}
}
}
},

-- Exported by package 'config'
"config",
}

max_line_length = 200

ignore = {
"212",
"213",
"411", -- ignore was previously defined
"422", -- ignore shadowing
}

local conf_rules = {
read_globals = {
"instance_name",
},
globals = {
"box", "etcd",
}
}

exclude_files = {
"tests/tnt/.rocks/*",
}


files["etc/*.lua"] = conf_rules

0 comments on commit bb765d2

Please sign in to comment.