-
Notifications
You must be signed in to change notification settings - Fork 63
175 lines (149 loc) · 4.4 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
---
name: Lint
on:
pull_request:
branches:
- master
jobs:
lint_editorconfig:
name: Lint EditorConfig
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout changes
uses: actions/checkout@v3
- name: Lint EditorConfig
run: |
npm install -g eclint
eclint check
shell: bash
lint_markdown:
name: Lint Markdown
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout changes
uses: actions/checkout@v3
- name: Lint Markdown
uses: nosborn/github-action-markdown-cli@v1.1.1
with:
files: .
ignore_files: CHANGELOG.md
lint_yaml:
name: Lint Yaml
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout changes
uses: actions/checkout@v3
- name: Lint Yaml
uses: ibiqlik/action-yamllint@master
with:
strict: true
config_data: |
extends: default
rules:
line-length:
max: 120
level: warning
truthy:
allowed-values: ['true', 'false', 'on']
lint_python:
name: Lint Python
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout changes
uses: actions/checkout@v3
- name: Lint Python
uses: andymckay/pycodestyle-action@0.1.3
lint_java:
name: Lint Java/Android
runs-on: macos-latest
timeout-minutes: 20
strategy:
matrix:
golang:
- 1.18
steps:
- name: Checkout changes
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.golang }}
- name: Set GOPATH in env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
mkdir -p $(go env GOPATH)/src/github.com/ipfs-shipyard
ln -s $PWD $(go env GOPATH)/src/github.com/ipfs-shipyard/gomobile-ipfs
shell: bash
- name: Restore Go mod cache
id: cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('go/go.sum') }}
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: 1.8
- name: Set TARGET_SDK in env
run: |
pip3 install -r utils/manifest_get/requirements.txt
export GET_BIN=utils/manifest_get/manifest_get.py
export GET_KEY=global.android.target_sdk_version
echo "TARGET_SDK=$($GET_BIN $GET_KEY)" >> $GITHUB_ENV
- name: Install Android SDK
run: |
SDK_MAN=$HOME/Library/Android/sdk/tools/bin/sdkmanager;
BTOOLS=$($SDK_MAN --list | grep "build-tools;$TARGET_SDK");
BTOOL=$(echo $BTOOLS | tail -n1 | cut -d'|' -f1 | tr -d ' ');
PLATFORMS=$($SDK_MAN --list | grep "platforms;android-$TARGET_SDK");
PLATFORM=$(echo $PLATFORMS | tail -n1 | cut -d'|' -f1 | tr -d ' ');
$SDK_MAN --install "$BTOOL" platform-tools "$PLATFORM" ndk-bundle
> /dev/null
- name: Install Java 11
uses: actions/setup-java@v3
with:
java-version: 11
- name: Build Go Core
run: make build_core.android GOMOBILE_TARGET=/amd64
- name: Lint Java/Android
working-directory: android
run: ./gradlew lint
lint_swift:
name: Lint Swift
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout changes
uses: actions/checkout@v3
- name: Lint Swift
uses: norio-nomura/action-swiftlint@3.1.0
with:
args: --strict ios/Bridge/GomobileIPFS
lint_go:
name: Lint Golang
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
golang:
- 1.18
steps:
- name: Checkout changes
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.golang }}
- name: Install GolangCI-Lint
working-directory: go
run: curl -sSfL
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh
| sh -s v1.50.1
- name: Lint Golang
working-directory: go
run: ./bin/golangci-lint run -D unused --timeout 5m --skip-files deps.go