Skip to content

chore(pipeline): Install SwiftLint if missing #1090

chore(pipeline): Install SwiftLint if missing

chore(pipeline): Install SwiftLint if missing #1090

Workflow file for this run

name: Code Quality Checks
on: [workflow_dispatch, push]
jobs:
ESLint:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ./.github/actions/cancel_workflow
- uses: ./.github/actions/yarn_install
- name: Lint
run: yarn eslint
SwiftLint:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ./.github/actions/cancel_workflow
- name: swiftlint
run: |
function stripPWD() {
if ! ${WORKING_DIRECTORY+false};
then
cd - > /dev/null
fi
sed -E "s/$(pwd|sed 's/\//\\\//g')\///"
}
function convertToGitHubActionsLoggingCommands() {
sed -E 's/^(.*):([0-9]+):([0-9]+): (warning|error|[^:]+): (.*)/::\4 file=\1,line=\2,col=\3::\5/'
}
brew install swiftlint
set -o pipefail && yarn swiftlint | stripPWD | convertToGitHubActionsLoggingCommands
JavaLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: ./.github/actions/cancel_workflow
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
java:
- '**/*.java'
- uses: ./.github/actions/yarn_install
if: steps.changes.outputs.java == 'true'
- run: yarn javalint
if: steps.changes.outputs.java == 'true'
- uses: yutailang0119/action-android-lint@v3
if: steps.changes.outputs.java == 'true'
with:
report-path: android/build/reports/*.xml
continue-on-error: false