forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (120 loc) · 3.18 KB
/
mobile-format.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
name: mobile_format
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
env:
if: ${{ github.repository == 'envoyproxy/envoy' }}
uses: ./.github/workflows/_env.yml
permissions:
contents: read
formatall:
if: ${{ needs.env.outputs.mobile_formatting == 'true' }}
needs: env
permissions:
contents: read
packages: read
name: format_all
runs-on: ${{ needs.env.outputs.agent_ubuntu }}
timeout-minutes: 45
container:
image: ${{ needs.env.outputs.build_image_ubuntu }}
steps:
- uses: actions/checkout@v4
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy/envoy
- name: 'Run formatters'
run: |
cd mobile
./tools/check_format.sh
precommit:
if: ${{ needs.env.outputs.mobile_formatting == 'true' }}
needs: env
permissions:
contents: read
packages: read
name: precommit
runs-on: macos-12
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: 'Install precommit'
run: brew install pre-commit
- name: 'Run precommit'
run: |
cd mobile
find mobile/* | pre-commit run --files
swiftlint:
if: ${{ needs.env.outputs.mobile_formatting == 'true' }}
needs: env
permissions:
contents: read
packages: read
name: swift_lint
runs-on: ${{ needs.env.outputs.agent_ubuntu }}
timeout-minutes: 5
container:
image: ghcr.io/realm/swiftlint:0.50.3
steps:
- uses: actions/checkout@v4
- name: 'Run Swift Lint (SwiftLint)'
run: swiftlint lint --strict
working-directory: mobile
drstring:
if: ${{ needs.env.outputs.mobile_formatting == 'true' }}
needs: env
permissions:
contents: read
packages: read
name: drstring
runs-on: macos-12
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: 'Run DrString'
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app
run: |
cd mobile
./bazelw run --config=remote-ci @DrString//:drstring check
kotlinlint:
if: ${{ needs.env.outputs.mobile_formatting == 'true' }}
needs: env
permissions:
contents: read
packages: read
name: kotlin_lint
runs-on: macos-12
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: '8'
java-package: jdk
architecture: x64
distribution: zulu
- run: |
cd mobile
./ci/mac_ci_setup.sh
name: 'Install dependencies'
- name: 'Run Kotlin Lint (Detekt)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd mobile
./bazelw build \
--config=mobile-remote-ci-macos \
//library/kotlin/io/envoyproxy/envoymobile:envoy_lib_lint \
//examples/kotlin/hello_world:hello_envoy_kt_lint
- name: 'Run Kotlin Formatter (ktlint)'
run: |
cd mobile
./bazelw build --config=remote-ci kotlin_format