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

Build out CI workflow with linting, testing, and checking for stale translation files #23

Open
wants to merge 11 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
61 changes: 52 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,63 @@ on:
pull_request:

jobs:
build:
CI:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: 22.x
defaults:
run:
working-directory: ./react-native-expo

env:
# Enable colors
TERM: xterm-color
# Make the color readable
RED: '\033[0;31m'

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: yarn install
- run: yarn lint
- run: yarn test:ci
node-version: 22.x
cache: 'yarn'
cache-dependency-path: 'react-native-expo/yarn.lock'

- name: Restore cached node_modules
id: restore-node-modules-cache
uses: actions/cache/restore@v4
with:
path: ./react-native-expo/node_modules
key: cache-node-modules-${{ hashFiles('react-native-expo/yarn.lock') }}

- name: Install Yarn dependencies
run: yarn install
if: steps.restore-node-modules-cache.outputs.cache-hit != 'true'

- name: Cache node_modules
id: cache-node-modules
if: steps.restore-node-modules-cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: ./react-native-expo/node_modules
key: cache-node-modules-${{ hashFiles('react-native-expo/yarn.lock') }}

- name: Ensure all translations are extracted and compiled
# Thanks to https://stackoverflow.com/a/3878934/974981
run: |
yarn extract && \
yarn compile && \
git add . \
&& git diff --quiet \
&& git diff --cached --quiet || \
(\
echo -e "${RED}Running \`yarn extract && yarn compile\` resulted in a dirty Git working tree. To fix this, run \`yarn extract && yarn compile\` locally, commit the results, and then push back up." && \
exit 1\
)

- name: Lint
run: yarn lint

- name: Test
run: yarn test:ci
2 changes: 1 addition & 1 deletion react-native-expo/components/Icon/index.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CheckCircle, Home, Coins } from 'lucide-react-native';
import { Meta, StoryObj } from '@storybook/react/*';
import { Meta, StoryObj } from '@storybook/react';
import Icon from '.';
import dripsyTheme from '@/utils/dripsyTheme';

Expand Down
2 changes: 1 addition & 1 deletion react-native-expo/components/Text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Its component is the built-in `<Text />` component from Dripsy, so there is
* no component file separate from this story file.
*/
import { Meta, StoryObj } from '@storybook/react/*';
import { Meta, StoryObj } from '@storybook/react';
import dripsyTheme from '@/utils/dripsyTheme';
import { Text } from 'dripsy';

Expand Down
24 changes: 18 additions & 6 deletions react-native-expo/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ msgstr "A Shielded IBC Deposit allows you to transfer assets (e.g., ATOM, OSMO)
msgid "Allow notifications"
msgstr "Allow notifications"

#: components/HomeScreen/index.tsx:19
#: components/PortfolioScreen/BalanceList/index.tsx:17
msgid "Assets"
msgstr "Assets"

#: components/BalanceAndActions/index.tsx:21
msgid "Balance"
msgstr "Balance"

Expand All @@ -38,11 +42,11 @@ msgstr "Copied!"
msgid "Copy IBC address"
msgstr "Copy IBC address"

#: components/HomeScreen/index.tsx:26
#: components/BalanceAndActions/index.tsx:28
msgid "Deposit"
msgstr "Deposit"

#: components/TabsLayout/index.tsx:29
#: components/TabsLayout/index.tsx:30
msgid "Home"
msgstr "Home"

Expand All @@ -54,14 +58,18 @@ msgstr "Noble USDC deposit"
msgid "OK"
msgstr "OK"

#: components/TabsLayout/index.tsx:31
#: components/TabsLayout/index.tsx:32
msgid "Portfolio"
msgstr "Portfolio"

#: components/HomeScreen/index.tsx:29
#: components/BalanceAndActions/index.tsx:31
msgid "Request"
msgstr "Request"

#: components/HomeScreen/HomeScreenTransactionsList.tsx:12
msgid "See all"
msgstr "See all"

#: components/DepositFlow/DepositMethod.tsx:18
msgid "Select deposit method"
msgstr "Select deposit method"
Expand All @@ -76,10 +84,14 @@ msgstr "Shielded IBC deposit"
msgid "This address rotates for each deposit to ensure privacy in Penumbra's shielded pool."
msgstr "This address rotates for each deposit to ensure privacy in Penumbra's shielded pool."

#: components/TabsLayout/index.tsx:30
#: components/TabsLayout/index.tsx:31
msgid "Trade"
msgstr "Trade"

#: components/TransactionList/index.tsx:22
msgid "Transactions"
msgstr "Transactions"

#: components/TradeScreen/index.tsx:19
msgid "Turn on push notifications so you don't miss out when trading becomes available!"
msgstr "Turn on push notifications so you don't miss out when trading becomes available!"
Expand Down
2 changes: 1 addition & 1 deletion react-native-expo/locales/en/messages.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages=JSON.parse("{\"sLzgZw\":[\"A Shielded IBC Deposit allows you to transfer assets (e.g., ATOM, OSMO) from Cosmos-based networks into Penumbra's shielded pool. Once deposited, your assets become private and anonymous, ensuring maximum confidentiality when used within Penumbra.\"],\"iN398g\":[\"Allow notifications\"],\"fsBGk0\":[\"Balance\"],\"AUYALh\":[\"Coming soon\"],\"PiH3UR\":[\"Copied!\"],\"I3QmPd\":[\"Copy IBC address\"],\"kj3M8S\":[\"Deposit\"],\"i0qMbr\":[\"Home\"],\"fadWTs\":[\"Noble USDC deposit\"],\"zga9sT\":[\"OK\"],\"MqA4qt\":[\"Portfolio\"],\"OlFf9i\":[\"Request\"],\"ur8JAd\":[\"Select deposit method\"],\"uAjbeK\":[\"Shielded IBC deposit\"],\"hXaCWv\":[\"This address rotates for each deposit to ensure privacy in Penumbra's shielded pool.\"],\"JHxGP5\":[\"Trade\"],\"TFkfUQ\":[\"Turn on push notifications so you don't miss out when trading becomes available!\"],\"cd7LFT\":[\"What is a shielded IBC deposit?\"]}")as Messages;
/*eslint-disable*/import type{Messages}from"@lingui/core";export const messages=JSON.parse("{\"sLzgZw\":[\"A Shielded IBC Deposit allows you to transfer assets (e.g., ATOM, OSMO) from Cosmos-based networks into Penumbra's shielded pool. Once deposited, your assets become private and anonymous, ensuring maximum confidentiality when used within Penumbra.\"],\"iN398g\":[\"Allow notifications\"],\"GX8GKD\":[\"Assets\"],\"fsBGk0\":[\"Balance\"],\"AUYALh\":[\"Coming soon\"],\"PiH3UR\":[\"Copied!\"],\"I3QmPd\":[\"Copy IBC address\"],\"kj3M8S\":[\"Deposit\"],\"i0qMbr\":[\"Home\"],\"fadWTs\":[\"Noble USDC deposit\"],\"zga9sT\":[\"OK\"],\"MqA4qt\":[\"Portfolio\"],\"OlFf9i\":[\"Request\"],\"gukqfD\":[\"See all\"],\"ur8JAd\":[\"Select deposit method\"],\"uAjbeK\":[\"Shielded IBC deposit\"],\"hXaCWv\":[\"This address rotates for each deposit to ensure privacy in Penumbra's shielded pool.\"],\"JHxGP5\":[\"Trade\"],\"4wyw8H\":[\"Transactions\"],\"TFkfUQ\":[\"Turn on push notifications so you don't miss out when trading becomes available!\"],\"cd7LFT\":[\"What is a shielded IBC deposit?\"]}")as Messages;
2 changes: 0 additions & 2 deletions react-native-expo/modules/penumbra-sdk-module/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { NativeModulesProxy, EventEmitter, Subscription } from 'expo-modules-core';

// Import the native module. On web, it will be resolved to PenumbraSdkModule.web.ts
// and on native platforms to PenumbraSdkModule.ts
import PenumbraSdkModule from './src/PenumbraSdkModule';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// Fake module for web
export default {
};
export default {};
2 changes: 0 additions & 2 deletions react-native-expo/store/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ export const balancesSlice = createSlice({
reducers: {},
});

export const {} = balancesSlice.actions;

export default balancesSlice.reducer;
Loading