Skip to content
Merged
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
98 changes: 0 additions & 98 deletions .circleci/config.yml

This file was deleted.

196 changes: 196 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
install-dependencies:
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache-deps.outputs.cache-hit }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock', 'example/yarn.lock') }}
restore-keys: |
${{ runner.os }}-deps-

- name: Install dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
yarn install --cwd example --frozen-lockfile
yarn install --frozen-lockfile

- name: Upload workspace
uses: actions/upload-artifact@v4
with:
name: workspace
path: |
.
!node_modules/.cache
!example/node_modules/.cache
retention-days: 1

lint:
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock', 'example/yarn.lock') }}
restore-keys: |
${{ runner.os }}-deps-

- name: Lint files
run: yarn lint

typescript:
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock', 'example/yarn.lock') }}
restore-keys: |
${{ runner.os }}-deps-

- name: Typecheck files
run: yarn typescript

unit-tests:
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock', 'example/yarn.lock') }}
restore-keys: |
${{ runner.os }}-deps-

- name: Run unit tests
run: yarn test --coverage

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/
retention-days: 30

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ./coverage/
fail_ci_if_error: false

build-package:
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock', 'example/yarn.lock') }}
restore-keys: |
${{ runner.os }}-deps-

- name: Build package
run: yarn prepare

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: lib/
retention-days: 30

# Summary job that depends on all other jobs
ci-complete:
runs-on: ubuntu-latest
needs: [lint, typescript, unit-tests, build-package]
if: always()
steps:
- name: Check all jobs status
run: |
if [[ "${{ needs.lint.result }}" == "failure" || "${{ needs.typescript.result }}" == "failure" || "${{ needs.unit-tests.result }}" == "failure" || "${{ needs.build-package.result }}" == "failure" ]]; then
echo "One or more jobs failed"
exit 1
else
echo "All jobs completed successfully"
fi
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies 🔧
run: yarn install --frozen-lockfile
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@ android/keystores/debug.keystore
# generated by bob
lib/

# coverage reports
coverage/

.xcode.env.local
2 changes: 1 addition & 1 deletion example/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {AppRegistry} from 'react-native';
import { AppRegistry } from 'react-native';
import App from './src/App';

AppRegistry.registerComponent('main', () => App);
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function App() {
-1,
true
);
}, []);
}, [animatedHeight, animatedWidth]);

const animatedStyle = useAnimatedStyle(() => ({
width: `${animatedWidth.value}%`,
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"!**/__mocks__"
],
"scripts": {
"test": "jest",
"test": "jest --passWithNoTests",
"typescript": "tsc --noEmit",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"prepare": "bob build",
Expand Down Expand Up @@ -101,7 +101,8 @@
},
"eslintIgnore": [
"node_modules/",
"lib/"
"lib/",
"coverage/"
],
"prettier": {
"quoteProps": "consistent",
Expand Down
5 changes: 3 additions & 2 deletions src/ShadowedView.android.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import {
I18nManager,
StyleProp,
StyleSheet,
StyleProp, // eslint-disable-line @typescript-eslint/no-unused-vars
ViewProps,
ViewStyle,
ViewStyle, // eslint-disable-line @typescript-eslint/no-unused-vars
} from 'react-native';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { FastShadowView, FastShadowViewProps } from './FastShadowView';

export class ShadowedView extends React.Component<ViewProps> {
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { ColorValue, Platform, ViewStyle } from 'react-native';

export type ShadowParams = {
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"importsNotUsedAsValues": "error",
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["esnext"],
Expand All @@ -24,5 +23,6 @@
"skipLibCheck": true,
"strict": true,
"target": "esnext"
}
},
"exclude": ["example"]
}
Loading