Skip to content

Commit c9a40f1

Browse files
committed
ci: put static code check into a separate job
With this approach static check failures don't block unit/integration tests. Part of TNTP-6083
1 parent 7dd32dc commit c9a40f1

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

.github/actions/static-code-check/action.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@ description: "Performs static code checks."
44
runs:
55
using: "composite"
66
steps:
7-
- name: Log versions
7+
- name: Setup Go
8+
uses: actions/setup-go@v4
9+
with:
10+
go-version: '${{ env.GO_VERSION }}'
11+
12+
- name: Setup Mage
813
run: |
9-
go version
10-
mage --version
11-
tarantool --version
12-
rpm --version
14+
git clone https://github.com/magefile/mage
15+
cd mage
16+
go run bootstrap.go
1317
shell: bash
1418

15-
- name: License checker
16-
run: |
17-
go install github.com/uw-labs/lichen@latest
18-
mage checklicenses
19+
# This step is used to perform source generation, so subsequent check is done
20+
# against the "complete" source set.
21+
- name: Build tt
22+
env:
23+
TT_CLI_BUILD_SSL: 'static'
24+
run: mage build
1925
shell: bash
2026

2127
- name: Find git base branch
@@ -24,6 +30,7 @@ runs:
2430
HASH=$(git log --format='%H^%D' | grep 'origin/' | head -n 2 | tail -n 1 | cut -f1 -d^)
2531
echo "Found base branch with hash: '${HASH}'"
2632
echo "BASE_BRANCH=${HASH}" >> ${GITHUB_ENV}
33+
echo "Python venv path: '${VIRTUAL_ENV}'"
2734
2835
- name: pre-commit checks (diff)
2936
uses: pre-commit/action@v3.0.1

.github/workflows/tests.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ jobs:
2626
- name: Check commit messages
2727
uses: ./.github/actions/check-commit-msg
2828

29+
static-code-check:
30+
if: github.event_name == 'push'
31+
runs-on: ubuntu-22.04
32+
steps:
33+
- uses: actions/checkout@master
34+
with:
35+
fetch-depth: 0
36+
submodules: recursive
37+
38+
- name: Static code check
39+
uses: ./.github/actions/static-code-check
40+
2941
tests-ce:
3042
if: |
3143
(github.event_name == 'push') ||
@@ -48,8 +60,11 @@ jobs:
4860
with:
4961
tarantool-version: '${{ matrix.tarantool-version }}'
5062

51-
- name: Static code check
52-
uses: ./.github/actions/static-code-check
63+
- name: License checker
64+
run: |
65+
go install github.com/uw-labs/lichen@latest
66+
mage checklicenses
67+
shell: bash
5368

5469
- name: Unit tests
5570
run: mage unit
@@ -138,9 +153,6 @@ jobs:
138153
sdk-version: '${{ matrix.sdk-version }}'
139154
sdk-download-token: '${{ secrets.SDK_DOWNLOAD_TOKEN }}'
140155

141-
- name: Static code check
142-
uses: ./.github/actions/static-code-check
143-
144156
- name: Unit tests
145157
run: mage unit
146158

0 commit comments

Comments
 (0)