Skip to content

Commit

Permalink
Merge pull request #324 from aarongrider/actions
Browse files Browse the repository at this point in the history
Add GitHub Actions for Linting and Building Example Projects
  • Loading branch information
aarongrider authored Oct 25, 2020
2 parents d29aca2 + e4a6d0b commit 19c6717
Show file tree
Hide file tree
Showing 36 changed files with 888 additions and 24 deletions.
61 changes: 61 additions & 0 deletions .eslintrc.js
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,
},
};
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
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
13 changes: 13 additions & 0 deletions .github/workflows/linter.yml
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
2 changes: 1 addition & 1 deletion ReactNativeCameraKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.platform = :ios, "10.0"

s.source = { :git => "https://github.com/teslamotors/react-native-camera-kit.git", :tag => "v#{s.version}" }
s.source_files = "ios/lib/**/*.{h,m}"
s.source_files = "ios/**/*.{h,m}"

s.dependency 'React'
end
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ SPEC CHECKSUMS:
React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d
React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
ReactNativeCameraKit: f20c21c45aeca58756d11e0e043ef3e387e79267
ReactNativeCameraKit: 5026c5884617eab92b096b62262eec2bbf9eb647
Yoga: 3ebccbdd559724312790e7742142d062476b698e
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

Expand Down
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.
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"source": "src/index",
"scripts": {
"test": "jest",
"lint": "yarn eslint -c .eslintrc.js",
"start": "watchman watch-del-all && node node_modules/react-native/local-cli/cli.js start",
"example": "yarn --cwd example",
"pods": "cd example && pod-install --quiet",
Expand All @@ -24,16 +25,20 @@
},
"license": "MIT",
"devDependencies": {
"@react-native-community/eslint-config": "^2.0.0",
"@types/jest": "^26.0.0",
"@types/react": "^16.9.19",
"@types/react-native": "0.62.13",
"babel-jest": "22.4.1",
"eslint": "^7.11.0",
"eslint-plugin-import": "^2.22.1",
"jest": "^26.0.1",
"metro-react-native-babel-preset": "0.51.0",
"pod-install": "^0.1.0",
"prettier": "^2.1.2",
"react": "16.11.0",
"react-native": "0.62.2",
"babel-jest": "22.4.1",
"react-test-renderer": "16.6.0",
"metro-react-native-babel-preset": "0.51.0"
"react-test-renderer": "16.6.0"
},
"peerDependencies": {
"react": "*",
Expand Down
Loading

0 comments on commit 19c6717

Please sign in to comment.