-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from aarongrider/actions
Add GitHub Actions for Linting and Building Example Projects
- Loading branch information
Showing
36 changed files
with
888 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native-community', | ||
plugins: ['import'], | ||
rules: { | ||
// disabled rules | ||
'prettier/prettier': 'off', | ||
'react-native/no-inline-styles': 'off', | ||
'no-fallthrough': 'off', | ||
curly: 'off', | ||
// error rules | ||
semi: 'error', | ||
'key-spacing': [2, { beforeColon: false, afterColon: true }], | ||
'require-await': 'error', | ||
indent: [ | ||
'error', | ||
2, | ||
{ | ||
ignoredNodes: ['TemplateLiteral'], // https://github.com/babel/babel-eslint/issues/681#issuecomment-451336031 | ||
SwitchCase: 1, | ||
}, | ||
], | ||
'no-console': 'error', | ||
'no-debugger': 'error', | ||
'prefer-const': 'error', | ||
'no-multiple-empty-lines': 'error', | ||
'no-unused-vars': 'error', | ||
'no-trailing-spaces': 'error', | ||
'brace-style': ['error', '1tbs', { allowSingleLine: true }], | ||
'react/jsx-boolean-value': 'error', | ||
'react/jsx-closing-bracket-location': 'error', | ||
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }], | ||
'max-len': [ | ||
'error', | ||
{ | ||
code: 120, | ||
ignoreTemplateLiterals: true, | ||
// FIXME: doesn't work :/ | ||
ignorePattern: '^log\\(', // ignore "log('...')" | ||
ignoreUrls: true, // ignore long urls | ||
}, | ||
], | ||
'import/no-unresolved': ['error', { commonjs: true, amd: true }], | ||
'import/named': 'error', | ||
'import/namespace': 'error', | ||
'import/default': 'error', | ||
'import/export': 'error', | ||
}, | ||
settings: { | ||
'import/ignore': ['node_modules/react-native/index\\.js$'], // https://github.com/facebook/react-native/issues/28549 | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.ts', '.android.js', '.ios.js'], | ||
}, | ||
}, | ||
}, | ||
globals: { | ||
WebSocket: true, | ||
URLSearchParams: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Build | ||
on: push | ||
jobs: | ||
build-example-ios: | ||
name: build-example-ios | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn | ||
- name: Bootstrap | ||
run: yarn bootstrap | ||
- name: Build | ||
run: cd example/ios && xcodebuild -workspace CameraKitExample.xcworkspace -configuration Debug -scheme CameraKitExample -arch x86_64 | ||
build-example-android: | ||
name: build-example-android | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn | ||
- name: Bootstrap | ||
run: yarn bootstrap | ||
- name: Build | ||
run: cd example/android && ./gradlew assembleDebug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Linter | ||
on: push | ||
jobs: | ||
eslint: | ||
name: ESLint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn | ||
- name: Lint | ||
run: yarn lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.