Skip to content

Commit fdcf9cb

Browse files
authored
GSW-2020 build: support tlin in ci (#424)
* build: support tlin in ci * fix: cd * fix: ci * fix: get changed directories * feat: run tlin for changed dir * build: bump tj-action version
1 parent 0b2f4ae commit fdcf9cb

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

Diff for: .github/workflows/tlin_check.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: tlin-check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
tlin-check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout code
13+
uses: actions/checkout@v3
14+
with:
15+
ref: ${{ github.event.pull_request.head.ref }}
16+
- name: checkout tlin
17+
uses: actions/checkout@v3
18+
with:
19+
repository: gnoverse/tlin
20+
ref: main
21+
path: ./tlin
22+
- name: setup go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: 1.22
26+
- name: changed directories
27+
id: changed_directories
28+
uses: tj-actions/changed-files@v45
29+
with:
30+
dir_names: "true"
31+
- name: list changed directories
32+
run: |
33+
echo "Changed directories: ${{ steps.changed_directories.outputs.all_changed_files }}"
34+
- name: install tlin
35+
run: |
36+
cd tlin
37+
go install ./cmd/tlin
38+
- name: tlin check
39+
run: |
40+
for directory in ${{ steps.changed_directories.outputs.all_changed_files }}; do
41+
echo "checking $directory ..."
42+
tlin $directory
43+
done

0 commit comments

Comments
 (0)