Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ module.exports = {
},
ecmaVersion: 2018,
},
plugins: ['react', 'react-native', '@react-native-community', 'prettier'],
extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:prettier/recommended', '@react-native-community'],
plugins: ['react', 'react-native', '@react-native-community', 'prettier', 'react-hooks'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
'@react-native-community',
'plugin:react-hooks/recommended',
],
rules: {
// eslint
semi: 'off',
curly: ['warn', 'multi-or-nest', 'consistent'],
'no-bitwise': 'off', // required for blurhash
'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'],
'no-async-promise-executor': 'warn',
'require-await': 'warn',
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build Android App

on:
push:
branches:
- main
paths:
- '.github/workflows/build-android.yml'
- 'android/**'
- 'example/android/**'
- 'yarn.lock'
- 'example/yarn.lock'
pull_request:
paths:
- '.github/workflows/build-android.yml'
- 'android/**'
- 'example/android/**'
- 'yarn.lock'
- 'example/yarn.lock'

jobs:
build:
name: Build Android Example App
runs-on: ubuntu-latest
defaults:
run:
working-directory: example/android
steps:
- uses: actions/checkout@v2

- name: Setup JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..

- name: Restore Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build
run: ./gradlew assembleDebug
96 changes: 96 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build Documentation

on:
pull_request:
branches:
- main
paths:
- '.github/workflows/build-docs.yml'
- 'docs/**'
- 'src/**'
- '*.json'
- '*.js'
- '*.lock'
push:
branches:
- main
paths:
- '.github/workflows/build-docs.yml'
- 'docs/**'
- 'src/**'
- '*.json'
- '*.js'
- '*.lock'

jobs:
checks:
if: github.event_name != 'push'
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Test Docs Build
run: |
yarn install --frozen-lockfile
cd docs
yarn install --frozen-lockfile
yarn build
gh-release:
if: github.event_name != 'pull_request'
name: Deploy Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
cat <<EOT >> ~/.ssh/config
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa
EOT

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: git
CURRENT_BRANCH: main
DEPLOYMENT_BRANCH: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "actions@github.com"
git config --global user.name "gh-actions"
yarn install --frozen-lockfile
cd docs
yarn install --frozen-lockfile
yarn deploy
70 changes: 70 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build iOS App

on:
push:
branches:
- main
paths:
- '.github/workflows/build-ios.yml'
- 'ios/**'
- '*.podspec'
- 'example/ios/**'
pull_request:
paths:
- '.github/workflows/build-ios.yml'
- 'ios/**'
- '*.podspec'
- 'example/ios/**'

jobs:
build:
name: Build iOS Example App
runs-on: macOS-latest
defaults:
run:
working-directory: example/ios
steps:
- uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..

- name: Setup Ruby (bundle)
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
working-directory: example/ios

- name: Restore Pods cache
uses: actions/cache@v2
with:
path: |
example/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Pods
run: pod install
- name: Build App
run: "xcodebuild \
-workspace VisionCameraExample.xcworkspace \
-scheme VisionCameraExample \
-sdk iphonesimulator \
-configuration Debug \
-destination \"generic/platform=iOS Simulator\" \
build \
CODE_SIGNING_ALLOWED=NO"
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/lint-example.yml

This file was deleted.

Loading