From bfd96d9ccc9dec75ff9fffbdef2e8071cdc8518f Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 20:30:00 -0700 Subject: [PATCH 1/9] Automatically organize imports --- App.tsx | 6 +++--- component/charts/bar-graph/bar-graph.tsx | 10 +++++----- component/charts/custom-bar-utils.ts | 2 +- component/charts/custom-bars.tsx | 2 +- component/charts/line-graph/line-graph.tsx | 6 +++--- component/charts/use-graph-data.ts | 2 +- component/shot.tsx | 2 +- component/video/camera.tsx | 13 ++++++------- component/video/capture-button.tsx | 8 ++++---- component/video/is-foreground.tsx | 2 +- component/with-query-handling.tsx | 2 +- graphql/client.tsx | 20 ++++++++++---------- navigation/app-navigator.tsx | 6 +++--- navigation/tab-navigator.tsx | 2 +- package.json | 7 ++++++- screens/login.tsx | 8 ++++---- screens/session.tsx | 2 +- screens/video-stack/record.tsx | 10 +++++----- test/component/bar-graph.test.tsx | 2 +- test/component/chart-label.test.tsx | 4 ++-- test/component/chart-view.test.tsx | 4 ++-- test/component/custom-bars.test.tsx | 6 +++--- test/component/line-graph.test.tsx | 2 +- test/component/use-graph-data.test.tsx | 2 +- test/component/with-query-handling.test.tsx | 8 ++++---- 25 files changed, 71 insertions(+), 67 deletions(-) diff --git a/App.tsx b/App.tsx index d069053..58c441e 100644 --- a/App.tsx +++ b/App.tsx @@ -1,7 +1,7 @@ -import React from "react"; -import AppNavigator from "./navigation/app-navigator"; -import { ClientProvider, useAuthHeader } from "./graphql/client"; import { DEV_USER_ID } from "@env"; +import React from "react"; +import { ClientProvider, useAuthHeader } from "./graphql/client"; +import AppNavigator from "./navigation/app-navigator"; const SetAuthHeaderBasedOnEnv = () => { const { setAuthHeader } = useAuthHeader(); diff --git a/component/charts/bar-graph/bar-graph.tsx b/component/charts/bar-graph/bar-graph.tsx index 2220273..9c6593d 100644 --- a/component/charts/bar-graph/bar-graph.tsx +++ b/component/charts/bar-graph/bar-graph.tsx @@ -1,16 +1,16 @@ -import React from "react"; import * as scale from "d3-scale"; +import React from "react"; import { View } from "react-native"; import { BarChart, XAxis, YAxis } from "react-native-svg-charts"; -import { useGraphData } from "../use-graph-data"; import { GraphData, YAxisProps } from "../graph-types"; +import { useGraphData } from "../use-graph-data"; -import { CustomBars } from "../custom-bars"; -import { CustomGrid } from "../custom-grid"; +import ChartLabel from "../chart-label/chart-label"; import { graphStyles } from "../chart-styles"; import ChartView from "../chart-view"; -import ChartLabel from "../chart-label/chart-label"; +import { CustomBars } from "../custom-bars"; +import { CustomGrid } from "../custom-grid"; interface Props { data: GraphData; diff --git a/component/charts/custom-bar-utils.ts b/component/charts/custom-bar-utils.ts index 58d6723..8c6041c 100644 --- a/component/charts/custom-bar-utils.ts +++ b/component/charts/custom-bar-utils.ts @@ -1,6 +1,6 @@ import { path as d3 } from "d3-path"; -import { ScaleLinearType, ScaleBandType } from "./graph-types"; +import { ScaleBandType, ScaleLinearType } from "./graph-types"; type BarCalculationProps = { scaleX: ScaleBandType; diff --git a/component/charts/custom-bars.tsx b/component/charts/custom-bars.tsx index f0d597c..ba3dd73 100644 --- a/component/charts/custom-bars.tsx +++ b/component/charts/custom-bars.tsx @@ -1,8 +1,8 @@ import { Svg } from "react-native-svg"; import { Bar } from "./bar"; -import { ScaleBandType, ScaleLinearType } from "./graph-types"; import { calculateBarWidth } from "./custom-bar-utils"; +import { ScaleBandType, ScaleLinearType } from "./graph-types"; export interface CombinedData { data: { value: number }[]; diff --git a/component/charts/line-graph/line-graph.tsx b/component/charts/line-graph/line-graph.tsx index 3f3001f..3b7af11 100644 --- a/component/charts/line-graph/line-graph.tsx +++ b/component/charts/line-graph/line-graph.tsx @@ -1,13 +1,13 @@ -import React from "react"; import * as shape from "d3-shape"; +import React from "react"; import { View } from "react-native"; import { LineChart, XAxis, YAxis } from "react-native-svg-charts"; -import { useGraphData } from "../use-graph-data"; -import { CustomGrid } from "../custom-grid"; import { graphStyles } from "../chart-styles"; import ChartView from "../chart-view"; +import { CustomGrid } from "../custom-grid"; import { CommonProps } from "../graph-types"; +import { useGraphData } from "../use-graph-data"; // TODO: separate PR will update useGraphData to take into account useCommonScale // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars diff --git a/component/charts/use-graph-data.ts b/component/charts/use-graph-data.ts index 81e0912..1be47db 100644 --- a/component/charts/use-graph-data.ts +++ b/component/charts/use-graph-data.ts @@ -1,8 +1,8 @@ import { useMemo } from "react"; -import { convertToGraphData } from "./graph-utils"; import { chartDefaults } from "./graph-config"; import { GraphData, GraphProps, XValue, YAxisData } from "./graph-types"; +import { convertToGraphData } from "./graph-utils"; interface useGraphDataInterface { xValues: Array; diff --git a/component/shot.tsx b/component/shot.tsx index e959534..5a7ca85 100644 --- a/component/shot.tsx +++ b/component/shot.tsx @@ -1,6 +1,6 @@ +import { GET_SHOTS } from "../graphql/query"; import DisplayShots from "./display-shot"; import withQueryHandling from "./with-query-handling"; -import { GET_SHOTS } from "../graphql/query"; const ShotsContainer = withQueryHandling({ WrappedComponent: DisplayShots, diff --git a/component/video/camera.tsx b/component/video/camera.tsx index c004fe4..fe3fd01 100644 --- a/component/video/camera.tsx +++ b/component/video/camera.tsx @@ -1,19 +1,18 @@ +import { useIsFocused } from "@react-navigation/native"; import React, { useCallback, useRef, useState } from "react"; import { Button, StyleSheet, Text, View } from "react-native"; import { Camera, - useCameraPermission, - useCameraDevice, - useCameraFormat, - PhotoFile, - VideoFile, CameraRuntimeError, Orientation, - // @ts-ignore + PhotoFile, + VideoFile, + useCameraDevice, + useCameraFormat, + useCameraPermission, } from "react-native-vision-camera"; import { RecordingButton } from "./capture-button"; import { useIsForeground } from "./is-foreground"; -import { useIsFocused } from "@react-navigation/native"; export default function CameraScreen({ route, diff --git a/component/video/capture-button.tsx b/component/video/capture-button.tsx index 331f708..6dd42c6 100644 --- a/component/video/capture-button.tsx +++ b/component/video/capture-button.tsx @@ -1,12 +1,12 @@ +import { CameraRoll } from "@react-native-camera-roll/camera-roll"; import React, { useCallback, useRef, useState } from "react"; import { - TouchableOpacity, - StyleSheet, - View, StyleProp, + StyleSheet, + TouchableOpacity, + View, ViewStyle, } from "react-native"; -import { CameraRoll } from "@react-native-camera-roll/camera-roll"; // @ts-ignore import { Camera } from "react-native-vision-camera/lib/typescript/Camera"; // @ts-ignore diff --git a/component/video/is-foreground.tsx b/component/video/is-foreground.tsx index 53a97dc..5e28ce0 100644 --- a/component/video/is-foreground.tsx +++ b/component/video/is-foreground.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import { useEffect, useState } from "react"; import { AppState, AppStateStatus } from "react-native"; export const useIsForeground = (): boolean => { diff --git a/component/with-query-handling.tsx b/component/with-query-handling.tsx index 9771452..c724317 100644 --- a/component/with-query-handling.tsx +++ b/component/with-query-handling.tsx @@ -1,5 +1,5 @@ +import { DocumentNode, OperationVariables, useQuery } from "@apollo/client"; import React from "react"; -import { useQuery, DocumentNode, OperationVariables } from "@apollo/client"; import { Text } from "react-native"; /** * A higher-order component that provides loading and error handling for GraphQL queries. diff --git a/graphql/client.tsx b/graphql/client.tsx index 21ecd34..ce6b86f 100644 --- a/graphql/client.tsx +++ b/graphql/client.tsx @@ -1,19 +1,19 @@ +import { + ApolloClient, + ApolloLink, + ApolloProvider, + HttpLink, + InMemoryCache, + from, +} from "@apollo/client"; +import { API_URI } from "@env"; import React, { ReactNode, createContext, useContext, - useState, useMemo, + useState, } from "react"; -import { - ApolloClient, - ApolloLink, - InMemoryCache, - ApolloProvider, - HttpLink, - from, -} from "@apollo/client"; -import { API_URI } from "@env"; type Props = { children: ReactNode; diff --git a/navigation/app-navigator.tsx b/navigation/app-navigator.tsx index a0cf33b..32ea4ce 100644 --- a/navigation/app-navigator.tsx +++ b/navigation/app-navigator.tsx @@ -1,13 +1,13 @@ -import { useColorScheme } from "react-native"; import { - NavigationContainer, DarkTheme, DefaultTheme, + NavigationContainer, } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; +import { useColorScheme } from "react-native"; -import Tabs from "./tab-navigator"; import Login from "../screens/login"; +import Tabs from "./tab-navigator"; const Stack = createNativeStackNavigator(); diff --git a/navigation/tab-navigator.tsx b/navigation/tab-navigator.tsx index f17ef11..dc1bcf3 100644 --- a/navigation/tab-navigator.tsx +++ b/navigation/tab-navigator.tsx @@ -1,8 +1,8 @@ import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; +import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { Image } from "react-native"; import CameraScreen from "../component/video/camera"; import Session from "../screens/session"; -import { createNativeStackNavigator } from "@react-navigation/native-stack"; import RecordScreen from "../screens/video-stack/record"; // TODO: add ts support for assets folder to use imports diff --git a/package.json b/package.json index a86edca..729818c 100644 --- a/package.json +++ b/package.json @@ -71,5 +71,10 @@ "prettier-plugin-organize-imports": "^3.2.4", "typescript": "^5.3.3" }, - "private": true + "private": true, + "prettier": { + "plugins": [ + "prettier-plugin-organize-imports" + ] + } } diff --git a/screens/login.tsx b/screens/login.tsx index 647b323..75e3e0a 100644 --- a/screens/login.tsx +++ b/screens/login.tsx @@ -1,14 +1,14 @@ -import React, { useState, useEffect } from "react"; +import auth, { FirebaseAuthTypes } from "@react-native-firebase/auth"; +import React, { useEffect, useState } from "react"; import { Alert, Button, - View, + Keyboard, Text, TextInput, TouchableWithoutFeedback, - Keyboard, + View, } from "react-native"; -import auth, { FirebaseAuthTypes } from "@react-native-firebase/auth"; // This code is beginning of Auth Implementation - actual implementation will differ and involve more UI // Does not have a restart or proper handling of code confirmation, should only be used for obtaining token/testing diff --git a/screens/session.tsx b/screens/session.tsx index 16c742d..d6c1af7 100644 --- a/screens/session.tsx +++ b/screens/session.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { View, StyleSheet } from "react-native"; +import { StyleSheet, View } from "react-native"; import BarGraph from "../component/charts/bar-graph/bar-graph"; import { graph_data_two_measures } from "../mock/charts/mock-data"; diff --git a/screens/video-stack/record.tsx b/screens/video-stack/record.tsx index bfe9a33..87ea17c 100644 --- a/screens/video-stack/record.tsx +++ b/screens/video-stack/record.tsx @@ -1,11 +1,11 @@ import React, { useCallback, useState } from "react"; import { - View, - TextInput, - TouchableWithoutFeedback, - Text, - TouchableOpacity, Keyboard, + Text, + TextInput, + TouchableOpacity, + TouchableWithoutFeedback, + View, } from "react-native"; import DropDownPicker from "react-native-dropdown-picker"; import { recordStyles as styles } from "./styles"; diff --git a/test/component/bar-graph.test.tsx b/test/component/bar-graph.test.tsx index 021f3df..d266f79 100644 --- a/test/component/bar-graph.test.tsx +++ b/test/component/bar-graph.test.tsx @@ -1,5 +1,5 @@ -import React from "react"; import { render } from "@testing-library/react-native"; +import React from "react"; import BarGraph from "../../component/charts/bar-graph/bar-graph"; import { graph_data_two_measures } from "../../mock/charts/mock-data"; diff --git a/test/component/chart-label.test.tsx b/test/component/chart-label.test.tsx index 639b974..ada7057 100644 --- a/test/component/chart-label.test.tsx +++ b/test/component/chart-label.test.tsx @@ -1,6 +1,6 @@ -import React from "react"; -import { render } from "@testing-library/react-native"; import "@testing-library/jest-native/extend-expect"; +import { render } from "@testing-library/react-native"; +import React from "react"; import ChartLabel from "../../component/charts/chart-label/chart-label"; diff --git a/test/component/chart-view.test.tsx b/test/component/chart-view.test.tsx index c49398e..a68615c 100644 --- a/test/component/chart-view.test.tsx +++ b/test/component/chart-view.test.tsx @@ -1,7 +1,7 @@ +import "@testing-library/jest-native/extend-expect"; +import { render } from "@testing-library/react-native"; import React from "react"; import { Text } from "react-native"; -import { render } from "@testing-library/react-native"; -import "@testing-library/jest-native/extend-expect"; import ChartView from "../../component/charts/chart-view"; diff --git a/test/component/custom-bars.test.tsx b/test/component/custom-bars.test.tsx index 71db4f5..33c7db1 100644 --- a/test/component/custom-bars.test.tsx +++ b/test/component/custom-bars.test.tsx @@ -1,13 +1,13 @@ -import React from "react"; -import { render } from "@testing-library/react-native"; import "@testing-library/jest-native/extend-expect"; +import { render } from "@testing-library/react-native"; import * as scale from "d3-scale"; +import React from "react"; -import { CustomBars } from "../../component/charts/custom-bars"; import { calculateBarOrigin, drawBarPath, } from "../../component/charts/custom-bar-utils"; +import { CustomBars } from "../../component/charts/custom-bars"; const mockYScaleFunction = scale.scaleLinear(); const mockXScaleFunction = scale.scaleBand(); diff --git a/test/component/line-graph.test.tsx b/test/component/line-graph.test.tsx index f3a679c..420cea4 100644 --- a/test/component/line-graph.test.tsx +++ b/test/component/line-graph.test.tsx @@ -1,5 +1,5 @@ -import React from "react"; import { render } from "@testing-library/react-native"; +import React from "react"; import LineGraph from "../../component/charts/line-graph/line-graph"; import { line_chart_two_y_data } from "../../mock/charts/mock-data"; diff --git a/test/component/use-graph-data.test.tsx b/test/component/use-graph-data.test.tsx index 773c787..6226280 100644 --- a/test/component/use-graph-data.test.tsx +++ b/test/component/use-graph-data.test.tsx @@ -1,6 +1,6 @@ import { renderHook } from "@testing-library/react-native"; -import { useGraphData } from "../../component/charts/use-graph-data"; import { GraphData, GraphProps } from "../../component/charts/graph-types"; +import { useGraphData } from "../../component/charts/use-graph-data"; describe("useGraphData", () => { it("should return correctly processed data from convertToGraphData", () => { diff --git a/test/component/with-query-handling.test.tsx b/test/component/with-query-handling.test.tsx index 970994d..768cb06 100644 --- a/test/component/with-query-handling.test.tsx +++ b/test/component/with-query-handling.test.tsx @@ -1,9 +1,9 @@ -import React from "react"; -import { render, cleanup, waitFor } from "@testing-library/react-native"; -import "@testing-library/jest-native/extend-expect"; import { gql, useQuery } from "@apollo/client"; -import withQueryHandling from "../../component/with-query-handling"; +import "@testing-library/jest-native/extend-expect"; +import { cleanup, render, waitFor } from "@testing-library/react-native"; +import React from "react"; import { Text } from "react-native"; +import withQueryHandling from "../../component/with-query-handling"; jest.mock("@apollo/client", () => ({ ...jest.requireActual("@apollo/client"), From 721e7282754022d08aabb2026843d5dee8ba680a Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 21:06:47 -0700 Subject: [PATCH 2/9] Add android build and make tsc find react-native-vision-camera --- .gitea/workflows/tests.yaml | 2 ++ component/video/camera.tsx | 1 + react-native-vision-camera | 2 +- tsconfig.json | 13 +++++++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 4682b3e..d6ab554 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -25,3 +25,5 @@ jobs: run: nix develop --impure --command bash -c 'export HOME=$PWD; prettier . --check' - name: test run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn run test --no-watchman' + - name: android-build + run: nix develop --impure --command bash -c 'cd android; ./gradlew assembleDebug' diff --git a/component/video/camera.tsx b/component/video/camera.tsx index fe3fd01..c0d6602 100644 --- a/component/video/camera.tsx +++ b/component/video/camera.tsx @@ -91,6 +91,7 @@ export default function CameraScreen({ format={format} onInitialized={onInitialized} onError={onError} + // @ts-ignore onVideoChunkReady={onVideoChunkReady} video={true} orientation={orientation} // TODO: #60 diff --git a/react-native-vision-camera b/react-native-vision-camera index 0e05fc3..1312c5b 160000 --- a/react-native-vision-camera +++ b/react-native-vision-camera @@ -1 +1 @@ -Subproject commit 0e05fc314fb759ec0944bf09c07aba9ad753fc2b +Subproject commit 1312c5be53fdf1912922a1412642e48200cff0aa diff --git a/tsconfig.json b/tsconfig.json index 217700c..116a4c7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,14 @@ { - "include": ["."], + "include": [".", "./react-native-vision-camera/package"], "exclude": ["node_modules", "./react-native-vision-camera/package"], - "extends": ["expo/tsconfig.base"] + "extends": ["expo/tsconfig.base"], + "compilerOptions": { + "allowJs": false, + "esModuleInterop": true, + "moduleResolution": "node", + "outDir": "lib", + "paths": { + "react-native-vision-camera": ["./react-native-vision-camera/package"] + } + } } From c93072d9b4bd8cb5cb7f3840078dea5a6453a1e9 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 21:10:16 -0700 Subject: [PATCH 3/9] Fix CI? --- .gitea/workflows/tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index d6ab554..61b6ba8 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -19,6 +19,8 @@ jobs: run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn config set link-folder . && yarn install' - name: lint run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn run lint' + - name: typecheck react-native-vision-camera + run: nix develop --impure --command bash -c 'export HOME=$PWD; cd ./react-native-vision-camera/package; yarn tsc --noEmit' - name: typecheck run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn tsc --noEmit' - name: prettier From 4ae2e7058625bbccd561f6a8fb338698af04bfc5 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 21:14:18 -0700 Subject: [PATCH 4/9] Take 2 --- .gitea/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 61b6ba8..39a04c8 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -20,9 +20,9 @@ jobs: - name: lint run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn run lint' - name: typecheck react-native-vision-camera - run: nix develop --impure --command bash -c 'export HOME=$PWD; cd ./react-native-vision-camera/package; yarn tsc --noEmit' + run: nix develop --impure --command bash -c 'export HOME=$PWD; cd ./react-native-vision-camera/package; tsc' - name: typecheck - run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn tsc --noEmit' + run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn tsc' - name: prettier run: nix develop --impure --command bash -c 'export HOME=$PWD; prettier . --check' - name: test From e7f5d1970717e6ab9efda43654b38238ef8c363e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 21:17:08 -0700 Subject: [PATCH 5/9] Please work --- .gitea/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 39a04c8..76f9338 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -20,7 +20,7 @@ jobs: - name: lint run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn run lint' - name: typecheck react-native-vision-camera - run: nix develop --impure --command bash -c 'export HOME=$PWD; cd ./react-native-vision-camera/package; tsc' + run: nix develop --impure --command bash -c 'export HOME=$PWD; cd ./react-native-vision-camera/package; yarn install && tsc' - name: typecheck run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn tsc' - name: prettier From b38c0994142853a139507c20763256a7a486672e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 21:27:33 -0700 Subject: [PATCH 6/9] Fix? --- tsconfig.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 116a4c7..177c2aa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "include": [".", "./react-native-vision-camera/package"], + "include": ["."], "exclude": ["node_modules", "./react-native-vision-camera/package"], "extends": ["expo/tsconfig.base"], "compilerOptions": { @@ -7,8 +7,9 @@ "esModuleInterop": true, "moduleResolution": "node", "outDir": "lib", + "baseUrl": ".", "paths": { - "react-native-vision-camera": ["./react-native-vision-camera/package"] + "react-native-vision-camera": ["./react-native-vision-camera/package/lib"] } } } From c7179bd0a0567267a59008cad63246a4a0bb2066 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 21:30:32 -0700 Subject: [PATCH 7/9] Fix android build --- .gitea/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 76f9338..390eba2 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -28,4 +28,4 @@ jobs: - name: test run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn run test --no-watchman' - name: android-build - run: nix develop --impure --command bash -c 'cd android; ./gradlew assembleDebug' + run: nix develop --impure --command bash -c 'export HOME=$PWD; cd android; ./gradlew assembleDebug' From 2e75f784dd9ce4b652c83f57626f1e92a3652b2c Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 21:35:31 -0700 Subject: [PATCH 8/9] Try a different variable --- .gitea/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 390eba2..7816b41 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -28,4 +28,4 @@ jobs: - name: test run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn run test --no-watchman' - name: android-build - run: nix develop --impure --command bash -c 'export HOME=$PWD; cd android; ./gradlew assembleDebug' + run: nix develop --impure --command bash -c 'export GRADLE_USER_HOME=$PWD; cd android; ./gradlew assembleDebug' From 18ec4bf9f1bc2f234a2fc2498095e497aefbd9a9 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 3 Feb 2024 21:48:05 -0700 Subject: [PATCH 9/9] Separate android into its own job --- .gitea/workflows/android.yaml | 11 +++++++++++ .gitea/workflows/tests.yaml | 3 --- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .gitea/workflows/android.yaml diff --git a/.gitea/workflows/android.yaml b/.gitea/workflows/android.yaml new file mode 100644 index 0000000..8c18199 --- /dev/null +++ b/.gitea/workflows/android.yaml @@ -0,0 +1,11 @@ +on: + push: + branches: + - master +jobs: + build: + name: Install + runs-on: nixos-x86_64-linux + steps: + - name: android-build + run: nix develop --impure --command bash -c 'export GRADLE_USER_HOME=$PWD; export HOME=$PWD; cd android; ./gradlew assembleDebug' diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index 7816b41..d851494 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -1,7 +1,6 @@ name: Tests on: pull_request: - env: NIXPKGS_ALLOW_UNFREE: 1 @@ -27,5 +26,3 @@ jobs: run: nix develop --impure --command bash -c 'export HOME=$PWD; prettier . --check' - name: test run: nix develop --impure --command bash -c 'export HOME=$PWD; yarn run test --no-watchman' - - name: android-build - run: nix develop --impure --command bash -c 'export GRADLE_USER_HOME=$PWD; cd android; ./gradlew assembleDebug'