chore: enhance CI tests (#3344)

* chore: add swift linter

* chore: add clang linters

* chore: add kotlin linter

* chore(ci): update workflows

* chore(ci): clean workflows
This commit is contained in:
Krzysztof Moch
2023-12-02 15:58:43 +01:00
committed by GitHub
parent 26043335e1
commit 91d7135562
15 changed files with 271 additions and 3 deletions

34
.github/workflows/check-android.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Check Android
on:
push:
branches:
- master
paths:
- '.github/workflows/check-android.yml'
- 'android/**'
pull_request:
paths:
- '.github/workflows/check-android.yml'
- 'android/**'
jobs:
Kotlin-Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.0.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
- name: run ktlint
working-directory: ./android/
run: |
ktlint --reporter=checkstyle,output=build/ktlint-report.xml --relative --editorconfig=./.editorconfig
continue-on-error: true
- uses: yutailang0119/action-ktlint@v3
with:
report-path: ./android/build/*.xml
continue-on-error: false
- uses: actions/upload-artifact@v3
with:
name: ktlint-report
path: ./android/build/*.xml

31
.github/workflows/check-clang.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Check CLang
on:
push:
branches:
- master
paths:
- '.github/workflows/check-clang.yml'
- 'ios/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/check-clang.yml'
- 'ios/**'
jobs:
CLang-Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt-get install clang-format
- name: Check ios clang formatting
run: |
find ios -type f \( -name "*.h" -o -name "*.cpp" -o -name "*.m" -o -name "*.mm" \) -print0 | while read -d $'\0' file; do
clang-format -style=file:./ios/.clang-format -i "$file"
done
shell: bash
- name: Check for changes
run: git diff --exit-code HEAD

41
.github/workflows/check-ios.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Check iOS
on:
push:
branches:
- master
paths:
- '.github/workflows/check-ios.yml'
- 'ios/**'
pull_request:
paths:
- '.github/workflows/check-ios.yml'
- 'ios/**'
jobs:
Swift-Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint with SwiftLint
uses: norio-nomura/action-swiftlint@master
with:
args: --strict
env:
WORKING_DIRECTORY: ios
Swift-Format:
runs-on: macOS-latest
defaults:
run:
working-directory: ./ios
steps:
- uses: actions/checkout@v4
- name: Install SwiftFormat
run: brew install swiftformat
- name: Format Swift code
run: swiftformat --verbose .
- name: Verify formatted code is unchanged
run: git diff --exit-code HEAD

View File

@@ -59,4 +59,4 @@ jobs:
run: yarn lint --fix
- name: Verify no files have changed after auto-fix
run: git diff --exit-code HEAD
run: git diff --exit-code HEAD