Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add workflows #31

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
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
37 changes: 37 additions & 0 deletions .github/workflows/gluestack-expo-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Gluestack-ui Expo App | Start and Build

on:
push:
branches:
- patch
pull_request:
branches:
- patch

jobs:
build:
runs-on: ubuntu-latest
env:
working-directory: expo-app
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x

- name: Install dependencies
working-directory: ${{ env.working-directory }}
run: yarn

- name: Start Expo on port 19006
working-directory: ${{ env.working-directory }}
run: |
yarn web --port 19006 &
sleep 60 # Wait for Expo to start

- name: Run tests
working-directory: ${{ env.working-directory }}
run: yarn test
31 changes: 31 additions & 0 deletions .github/workflows/gluestack-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Gluestack-ui Next App | Start and Build

on:
push:
branches:
- patch
pull_request:
branches:
- patch

jobs:
build:
runs-on: ubuntu-latest
env:
working-directory: next
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x

- name: Install dependencies
working-directory: ${{ env.working-directory }}
run: yarn

- name: Build Next
working-directory: ${{ env.working-directory }}
run: yarn build
34 changes: 34 additions & 0 deletions .github/workflows/universal-gluestack-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Universal App | Start and Build

on:
push:
branches:
- patch
pull_request:
branches:
- patch

jobs:
build:
runs-on: ubuntu-latest
env:
working-directory: universal
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x

- name: Install dependencies
run: yarn

- name: Install dependencies for Next app
working-directory: ${{ env.working-directory }}/apps/next
run: yarn

- name: Build Next
working-directory: ${{ env.working-directory }}
run: yarn build:next
3 changes: 2 additions & 1 deletion expo-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ expo-env.d.ts
# @end expo-cli
node_modules
.expo
dist
dist
coverage
10 changes: 10 additions & 0 deletions expo-app/__tests__/expo-app.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import { render, screen } from "@testing-library/react-native";
import App from "../app/index";

test("renders correctly", () => {
render(<App />);

// Check if a specific text or element is present in the component
expect(screen.getByText("SplashScreen")).toBeTruthy();
});
4 changes: 2 additions & 2 deletions expo-app/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button, ButtonText } from "@/components/ui/button";
import { router } from "expo-router";
import { SafeAreaView } from "@/components/ui/safe-area-view";
import { VStack } from "@/components/ui/vstack";
const index = () => {
function index() {
return (
<SafeAreaView className="md:flex flex-col items-center justify-center md:w-full h-full">
<VStack className="p-2 md:max-w-[440px] w-full" space="xl">
Expand Down Expand Up @@ -67,6 +67,6 @@ const index = () => {
</VStack>
</SafeAreaView>
);
};
}

export default index;
15 changes: 15 additions & 0 deletions expo-app/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
preset: "jest-expo",
roots: ["<rootDir>/__tests__"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
testEnvironment: "jsdom",
transformIgnorePatterns: [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@gluestack-ui/.*|tailwind-variants)",
],
setupFilesAfterEnv: ["@testing-library/jest-native/extend-expect"],
collectCoverageFrom: ["app/**/*.{ts,tsx}"],
reporters: ["default", "jest-junit"],

testMatch: ["<rootDir>/__tests__/**/*.test.(js|jsx)"],
forceExit: true,
};
7 changes: 7 additions & 0 deletions expo-app/junit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="jest tests" tests="1" failures="0" errors="0" time="26.07">
<testsuite name="undefined" errors="0" failures="0" skipped="0" timestamp="2024-09-19T12:14:21" time="24.97" tests="1">
<testcase classname=" renders correctly" name=" renders correctly" time="3.039">
</testcase>
</testsuite>
</testsuites>
10 changes: 5 additions & 5 deletions expo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
"android": "npx expo start --android",
"ios": "npx expo start --ios",
"web": "npx expo start --web",
"test": "jest --watchAll",
"test": "jest",
"postinstall": "patch-package"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/html-elements": "^0.10.1",
"@expo/vector-icons": "^14.0.0",
Expand Down Expand Up @@ -81,13 +78,16 @@
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@testing-library/jest-native": "^5.4.3",
"@testing-library/react-native": "^12.7.2",
"@types/react": "~18.2.45",
"@types/react-native": "^0.73.0",
"@unitools/babel-plugin-universal-image": "^1.0.0",
"autoprefixer": "^10.4.20",
"babel-plugin-module-resolver": "^5.0.2",
"jest": "^29.2.1",
"jest": "^29.7.0",
"jest-expo": "~51.0.1",
"jest-junit": "^16.0.0",
"jscodeshift": "0.15.2",
"react-test-renderer": "18.2.0",
"typescript": "~5.3.3"
Expand Down
Loading
Loading