Skip to content

Commit

Permalink
Merge branch 'main' of github.com:gluestack/gluestack-ui into fix/pop…
Browse files Browse the repository at this point in the history
…over-arrow
  • Loading branch information
rajat693 committed Nov 4, 2024
2 parents 603b2d5 + d7f4f8c commit 867ed24
Show file tree
Hide file tree
Showing 17 changed files with 1,570 additions and 22 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/expo-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Expo Latest

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC

jobs:
check-expo-version:
runs-on: macos-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
latest_version: ${{ steps.check.outputs.latest_version }}
steps:
- id: check
run: |
LATEST=$(npm view expo version)
CURRENT=$(cat .expo-version 2>/dev/null || echo "")
if [ "$LATEST" != "$CURRENT" ]; then
echo "should_run=true" >> $GITHUB_OUTPUT
echo "latest_version=$LATEST" >> $GITHUB_OUTPUT
echo $LATEST > .expo-version
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
test-expo-latest:
needs: check-expo-version
if: ${{ needs.check-expo-version.outputs.should_run == 'true' || github.event_name == 'push' || github.event_name == 'pull_request' }}
runs-on: macos-latest
name: Expo latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Create Expo project
run: |
npx create-expo-app@latest test-app
cd test-app
- name: Install dependencies
working-directory: test-app
run: |
npm install react-native-web react-dom @expo/metro-runtime
- name: Install gluestack-ui
working-directory: test-app
run: |
npx gluestack-ui init --template-only --projectType expo
npx gluestack-ui add --all
npx tailwindcss -i ./global.css -o ./node_modules/.cache/nativewind/global.css
- name: Add Button component
working-directory: test-app
run: |
mkdir -p app/\(tabs\)
cat <<EOT > app/\(tabs\)/index.tsx
import React from 'react';
import { View } from 'react-native';
import { Button, ButtonText } from '@/components/ui/button';
export default function App() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Button size="md" variant="solid" action="primary">
<ButtonText>Hello World!</ButtonText>
</Button>
</View>
);
}
EOT
- name: Start Expo web app
working-directory: test-app
run: |
npm run web & sleep 30
- name: Check if button is rendered
run: |
echo "First curl attempt:"
curl -s http://localhost:8081 | tee curl_output_1.log
echo "Waiting for 30 seconds..."
sleep 30
echo "Second curl attempt:"
curl -s http://localhost:8081 | tee curl_output_2.log
echo "Searching for 'Hello World!' in the output:"
if grep -q "Hello World!" curl_output_1.log || grep -q "Hello World!" curl_output_2.log; then
echo "Button found on the page"
exit 0
else
echo "Button not found on the page"
exit 1
fi
notify:
needs: test-expo-latest
if: always() && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: macos-latest
steps:
- name: Slack Notification
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: 'Expo Latest Test: ${{ job.status }}'
fields: repo,commit,action,eventName
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
104 changes: 104 additions & 0 deletions .github/workflows/next-13.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Next.js 13.x

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC

jobs:
test-next-13:
runs-on: ubuntu-latest
name: Next.js 13
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Create Next.js project
run: |
npx create-next-app@13 test-app --typescript --eslint --tailwind --app --src-dir --use-npm --no-experimental-app
cd test-app
- name: Install gluestack-ui
working-directory: test-app
run: |
npx gluestack-ui init --template-only --projectType nextjs
npx gluestack-ui add --all
- name: Rename original next.config file
working-directory: test-app
run: mv next.config.js next.config.original.js
- name: Create new next.config file
working-directory: test-app
run: |
cat <<EOT > next.config.js
const originalConfig = require('./next.config.original.js');
/** @type {import('next').NextConfig} */
const nextConfig = {
...originalConfig,
typescript: {
ignoreBuildErrors: true,
},
};
module.exports = nextConfig;
EOT
- name: Add Button component
working-directory: test-app
run: |
cat <<EOT > src/app/page.tsx
import {
Button,
ButtonText,
ButtonSpinner,
ButtonIcon,
ButtonGroup,
} from "@/components/ui/button"
export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<Button size="md" variant="solid" action="primary">
<ButtonText>Hello World!</ButtonText>
</Button>
</main>
)
}
EOT
- name: Build Next.js app
working-directory: test-app
env:
NEXT_TELEMETRY_DISABLED: 1
run: |
echo "{ \"extends\": \"next/core-web-vitals\", \"rules\": {} }" > .eslintrc.json
npm run build -- --no-lint
- name: Start Next.js app
working-directory: test-app
run: npm run start & sleep 10
- name: Check if button is rendered
run: |
if curl -s http://localhost:3000 | grep -q "Hello World!"; then
echo "Button found on the page"
exit 0
else
echo "Button not found on the page"
exit 1
fi
notify:
needs: test-next-13
if: always() && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: 'Next.js 13 Test: ${{ job.status }}'
fields: repo,commit,action,eventName
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
104 changes: 104 additions & 0 deletions .github/workflows/next-14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Next.js 14.x

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC

jobs:
test-next-14:
runs-on: ubuntu-latest
name: Next.js 14
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Create Next.js project
run: |
npx create-next-app@14 test-app --typescript --eslint --tailwind --app --src-dir --use-npm --no-experimental-app
cd test-app
- name: Install gluestack-ui
working-directory: test-app
run: |
npx gluestack-ui init --template-only --projectType nextjs
npx gluestack-ui add --all
- name: Rename original next.config file
working-directory: test-app
run: mv next.config.mjs next.config.original.mjs
- name: Create new next.config file
working-directory: test-app
run: |
cat <<EOT > next.config.mjs
import originalConfig from './next.config.original.mjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
...originalConfig,
typescript: {
ignoreBuildErrors: true,
},
};
export default nextConfig;
EOT
- name: Add Button component
working-directory: test-app
run: |
cat <<EOT > src/app/page.tsx
import {
Button,
ButtonText,
ButtonSpinner,
ButtonIcon,
ButtonGroup,
} from "@/components/ui/button"
export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<Button size="md" variant="solid" action="primary">
<ButtonText>Hello World!</ButtonText>
</Button>
</main>
)
}
EOT
- name: Build Next.js app
working-directory: test-app
env:
NEXT_TELEMETRY_DISABLED: 1
run: |
echo "{ \"extends\": \"next/core-web-vitals\", \"rules\": {} }" > .eslintrc.json
npm run build -- --no-lint
- name: Start Next.js app
working-directory: test-app
run: npm run start & sleep 10
- name: Check if button is rendered
run: |
if curl -s http://localhost:3000 | grep -q "Hello World!"; then
echo "Button found on the page"
exit 0
else
echo "Button not found on the page"
exit 1
fi
notify:
needs: test-next-14
if: always() && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: 'Next.js 14 Test: ${{ job.status }}'
fields: repo,commit,action,eventName
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading

0 comments on commit 867ed24

Please sign in to comment.