Skip to content

Fix CI test jobs fail to detect build failure #181

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

Merged
merged 50 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
682e44f
fix
yyyyaaa Jun 7, 2024
ab8baea
fix: add back lockfile
yyyyaaa Jun 7, 2024
837cd40
try new workflow
yyyyaaa Jun 7, 2024
61de921
f
yyyyaaa Jun 7, 2024
d11aea8
f
yyyyaaa Jun 7, 2024
c996abd
f
yyyyaaa Jun 7, 2024
5047f16
ff
yyyyaaa Jun 7, 2024
79f3592
f
yyyyaaa Jun 7, 2024
56f66ca
fff
yyyyaaa Jun 7, 2024
5a7aaea
use steps
yyyyaaa Jun 7, 2024
e3ff90b
ff
yyyyaaa Jun 7, 2024
e0db877
try
yyyyaaa Jun 7, 2024
34f6d9d
f
yyyyaaa Jun 7, 2024
a5d68bc
f
yyyyaaa Jun 7, 2024
d895843
fail
yyyyaaa Jun 7, 2024
929851b
use sth
yyyyaaa Jun 7, 2024
60e1cd0
rm
yyyyaaa Jun 7, 2024
9b73e47
rm
yyyyaaa Jun 7, 2024
01141dc
fix: build
yyyyaaa Jun 7, 2024
02de4dc
lock
yyyyaaa Jun 7, 2024
23f1b9d
try matrix again
yyyyaaa Jun 7, 2024
c743aa5
try
yyyyaaa Jun 7, 2024
4d7f28d
fail fast false
yyyyaaa Jun 7, 2024
e88e32a
oops
yyyyaaa Jun 7, 2024
b1506ce
mkdir
yyyyaaa Jun 7, 2024
02ab49d
yarn error
yyyyaaa Jun 7, 2024
bab1b08
fix
yyyyaaa Jun 7, 2024
aad1302
s
yyyyaaa Jun 7, 2024
2db98c4
dodo
yyyyaaa Jun 7, 2024
55392dd
fix
yyyyaaa Jun 7, 2024
eecf1a6
cancel
yyyyaaa Jun 7, 2024
f2998d6
typo
yyyyaaa Jun 7, 2024
5b37227
log
yyyyaaa Jun 7, 2024
da40cad
log
yyyyaaa Jun 7, 2024
d4fefea
oops
yyyyaaa Jun 7, 2024
84ecbd9
lock file
yyyyaaa Jun 7, 2024
5158e53
try 4
yyyyaaa Jun 7, 2024
c92f80a
yarn4 lockfile
yyyyaaa Jun 7, 2024
071741d
fix swap
yyyyaaa Jun 7, 2024
338d111
filter not working
yyyyaaa Jun 7, 2024
1d95e5f
fix
yyyyaaa Jun 7, 2024
6b3a6ee
fix authz
yyyyaaa Jun 7, 2024
80cc024
simplify
yyyyaaa Jun 7, 2024
5de4d61
fix
yyyyaaa Jun 7, 2024
0ead101
chakra
yyyyaaa Jun 7, 2024
ef4d4c3
fix cache
yyyyaaa Jun 7, 2024
a8c1af6
typo
yyyyaaa Jun 7, 2024
1ac64c5
yarn lock
yyyyaaa Jun 7, 2024
5136777
f
yyyyaaa Jun 8, 2024
68962c5
f
yyyyaaa Jun 8, 2024
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
82 changes: 82 additions & 0 deletions .github/workflows/run-tests-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build Next.js examples

on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
fail-fast: true
matrix:
example:
[
asset-list,
authz,
vote-proposal,
ibc-transfer,
swap-tokens,
provide-liquidity,
nft,
connect-chain,
connect-multi-chain,
]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set template_path Environment Variable
run: |
example_value="${{ matrix.example }}"

if [[ "$example_value" == "connect-chain" ]] || [[ "$example_value" == "connect-multi-chain" ]]; then
echo "template_path=templates" >> $GITHUB_ENV
echo "ci_template_path=dest" >> $GITHUB_ENV
else
echo "template_path=examples" >> $GITHUB_ENV
echo "ci_template_path=dest" >> $GITHUB_ENV
fi

- name: Log
run: |
echo "Using template_path: $template_path"
echo "Using ci_template_path: $ci_template_path"

- name: Clone example
run: |
echo "Cloning example: ./$template_path/${{ matrix.example }}/" into "${{ github.workspace }}/$ci_template_path/${{ matrix.example }}"

mkdir -p ${{ github.workspace }}/$ci_template_path/${{ matrix.example }}
cp -r ./$template_path/${{ matrix.example }}/ ${{ github.workspace }}/$ci_template_path/
cd ${{ github.workspace }}/$ci_template_path/${{ matrix.example }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Set up Yarn
uses: threeal/[email protected]

- name: Cache NextJS
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-

- name: Build example project
run: |
echo "Building example: ${{ matrix.example }} in directory ${{ github.workspace }}/$ci_template_path/${{ matrix.example }}"
cd ${{ github.workspace }}/$ci_template_path/${{ matrix.example }}
ls -la
yarn install
yarn build
20 changes: 10 additions & 10 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Run Tests
name: Run Tests Prod

on:
push:
pull_request:
types: [opened, synchronized, reopened]
branches:
- main
workflow_dispatch:

jobs:
Expand All @@ -18,23 +18,23 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: '20.x'

- name: Install Dependencies
run: npm install -g create-cosmos-app

- name: asset-list
run: |
cca --example asset-list --name asset-list
cd asset-list
yarn build

- name: vote-proposal
run: |
cca --example vote-proposal --name vote-proposal
cd vote-proposal
yarn build

# - name: asset-list
# run: |
# cca --example asset-list --name asset-list
# cd asset-list
# yarn build

# - name: ibc-transfer
# run: |
# cca --example ibc-transfer --name ibc-transfer
Expand Down
4 changes: 2 additions & 2 deletions boilerplates/ts-codegen-npm-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
"publish-scripts": "0.1.0",
"rimraf": "^5.0.0",
"ts-jest": "^29.1.0",
"typescript": "^5.0.4"
"typescript": "^5.1.6"
},
"dependencies": {
"@cosmjs/cosmwasm-stargate": "^0.31.0",
"@cosmwasm/ts-codegen": "^0.31.6"
}
}
}
4 changes: 2 additions & 2 deletions boilerplates/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@emotion/react": "11.10.6",
"@emotion/styled": "11.10.6",
"@interchain-ui/react": "^1.21.16",
"@interchain-ui/react": "^1.23.16",
"framer-motion": "9.0.7",
"next": "^13",
"react": "18.2.0",
Expand All @@ -34,6 +34,6 @@
"eslint": "8.28.0",
"eslint-config-next": "13.0.5",
"generate-lockfile": "0.0.12",
"typescript": "4.9.3"
"typescript": "^5.1.6"
}
}
2 changes: 1 addition & 1 deletion examples/asset-list/components/common/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Layout = ({ children }: { children?: React.ReactNode }) => {
bottom="0"
left="0"
right="0"
height="max(1dvh, 100%)"
flex={1}
backgroundColor={theme === 'light' ? '$white' : '$gray900'}
data-part-id="layout-container"
>
Expand Down
10 changes: 5 additions & 5 deletions examples/asset-list/components/wallet/WalletConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ export const ConnectWalletButton = ({
gap="$4"
as="span"
borderRadius="8px"
// @ts-ignore
style={{
zIndex: '1',
}}
zIndex={1}
color={useColorModeValue('$textInverse', '$text')}
>
<Box as="span">
<IoWallet />
</Box>

<Box as="span">{buttonText ? buttonText : 'Connect Wallet'}</Box>
<Box as="span" fontSize="$md" color="inherit">
{buttonText ? buttonText : 'Connect Wallet'}
</Box>
</Box>
</Button>
);
Expand Down
9 changes: 4 additions & 5 deletions examples/asset-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"@cosmos-kit/react": "2.10.9",
"@emotion/react": "11.10.6",
"@emotion/styled": "11.10.6",
"@interchain-ui/react": "^1.21.16",
"@interchain-ui/react": "^1.23.16",
"@interchain-ui/react-no-ssr": "^0.1.2",
"@tanstack/react-query": "4.32.0",
"@uidotdev/usehooks": "2.4.1",
"bignumber.js": "^9.1.2",
Expand All @@ -40,18 +41,16 @@
"osmo-query": "16.5.1",
"react": "^18.2",
"react-dom": "^18.2",
"react-icons": "^4.12.0",
"react-no-ssr": "1.1.0"
"react-icons": "^4.12.0"
},
"devDependencies": {
"@tanstack/react-query-devtools": "4.32.0",
"@types/node": "^20.8.4",
"@types/react": "^18.2.50",
"@types/react-dom": "^18.2.18",
"@types/react-no-ssr": "^1.1.7",
"eslint": "^8.56.0",
"eslint-config-next": "^14.1.0",
"generate-lockfile": "0.0.12",
"typescript": "^5"
"typescript": "^5.1.6"
}
}
2 changes: 0 additions & 2 deletions examples/asset-list/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) {
>
<QueryClientProvider client={queryClient}>
<main id="main" className={themeClass}>
{/* TODO fix type error */}
{/* @ts-ignore */}
<Component {...pageProps} />
</main>
</QueryClientProvider>
Expand Down
9 changes: 4 additions & 5 deletions examples/asset-list/pages/multi-chain.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import NoSSR from 'react-no-ssr';
import { ReactNoSSR } from '@interchain-ui/react-no-ssr';
import { ChainName } from 'cosmos-kit';
import { AssetListSection, Layout, WalletSection } from '@/components';

Expand All @@ -13,10 +13,9 @@ export default function MultiChain() {
providedChainName={chainName}
setChainName={setChainName}
/>
{/* TODO fix type error */}
{/* Type error: This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided. */}
{/* @ts-ignore */}
<NoSSR>{chainName && <AssetListSection chainName={chainName} />}</NoSSR>
<ReactNoSSR>
{chainName && <AssetListSection chainName={chainName} />}
</ReactNoSSR>
</Layout>
);
}
9 changes: 3 additions & 6 deletions examples/asset-list/pages/single-chain.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import NoSSR from 'react-no-ssr';
import { defaultChainName } from '@/config';
import { ReactNoSSR } from '@interchain-ui/react-no-ssr';
import { AssetListSection, Layout, WalletSection } from '@/components';

export default function SingleChain() {
return (
<Layout>
<WalletSection isMultiChain={false} />
{/* TODO fix type error */}
{/* Type error: This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided. */}
{/* @ts-ignore */}
<NoSSR>
<ReactNoSSR>
<AssetListSection chainName={defaultChainName} />
</NoSSR>
</ReactNoSSR>
</Layout>
);
}
2 changes: 2 additions & 0 deletions examples/asset-list/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@ h6 {

#main {
min-height: 100vh;
display: flex;
flex-direction: column;
}
Loading