Skip to content

Commit

Permalink
feat(ci): add ci checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tremarkley committed Nov 4, 2024
1 parent 5c18d08 commit 0a3011a
Show file tree
Hide file tree
Showing 42 changed files with 801 additions and 592 deletions.
13 changes: 13 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Setup
runs:
using: composite
steps:
- uses: pnpm/action-setup@v2

- name: pnpm install node modules
run: pnpm i --frozen-lockfile
shell: bash

- name: pnpm build
run: pnpm -r build
shell: bash
8 changes: 8 additions & 0 deletions .github/actions/supersim/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Supersim
runs:
using: composite
steps:
- name: Install Supersim
uses: jaxxstorm/action-install-gh-release@v1.10.0
with:
repo: ethereum-optimism/supersim
67 changes: 67 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Unit Tests

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: 'read'
actions: 'read'

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Run TypeChecker
run: |
pnpm -r typecheck
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Setup
uses: ./.github/actions/setup
- name: Run Linters
run: |
pnpm -r lint
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Setup
uses: ./.github/actions/setup
- name: Supersim Setup
uses: ./.github/actions/supersim
- name: Run Tests
run: |
pnpm -r test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "superchainerc20-starter",
"packageManager": "pnpm@9.0.2",
"description": "",
"scripts": {
"dev": "mprocs",
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"test": "vitest"
"test": "vitest --run"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-test/src/envVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { parseEnv, z } from 'znv'
import { Address as ZodAddress } from 'abitype/zod'

export const envVars = parseEnv(import.meta.env, {
VITE_TOKEN_CONTRACT_ADDRESS: ZodAddress,
VITE_TOKEN_MINTER_ADDRESS: ZodAddress,
VITE_TOKEN_CONTRACT_ADDRESS: ZodAddress.default("0x5BCf71Ca0CE963373d917031aAFDd6D98B80B159"),
VITE_TOKEN_MINTER_ADDRESS: ZodAddress.default("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"),
})
6 changes: 4 additions & 2 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint .",
"lint": "eslint \"**/*.{ts,tsx}\" && pnpm prettier --check \"**/*.{ts,tsx}\"",
"lint:fix": "eslint \"**/*.{ts,tsx}\" --fix --quiet && pnpm prettier \"**/*.{ts,tsx}\" --write --loglevel=warn",
"preview": "vite preview",
"shadcn:add": "pnpm dlx shadcn add"
"shadcn:add": "pnpm dlx shadcn add",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@eth-optimism/viem": "^0.0.11",
Expand Down
52 changes: 26 additions & 26 deletions packages/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import { ArrowLeftRight as BridgeIcon, Droplet, RefreshCw } from "lucide-react";
import { Bridge } from "@/Bridge";
import { Providers } from "@/Providers";
import { TokenSupply } from "@/TokenSupply";
import { WalletBalance } from "@/components/WalletBalance";
import { Card } from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Faucet } from "@/Faucet";
import { ConnectWalletButton } from "@/components/connect-wallet/ConnectWalletButton";
import { TokenInfo } from "@/components/TokenInfo";
import { TokenAggregateSupply } from "@/components/TokenAggregateSupply";
import { useStartIndexer } from "@/hooks/useIndexer";
import { Button } from "@/components/ui/button";
import { RecentActivity } from "@/components/RecentActivity";
import { useAccount } from "wagmi";
import { ArrowLeftRight as BridgeIcon, Droplet, RefreshCw } from 'lucide-react'
import { Bridge } from '@/Bridge'
import { Providers } from '@/Providers'
import { WalletBalance } from '@/components/WalletBalance'
import { Card } from '@/components/ui/card'
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { Faucet } from '@/Faucet'
import { ConnectWalletButton } from '@/components/connect-wallet/ConnectWalletButton'
import { TokenInfo } from '@/components/TokenInfo'
import { TokenAggregateSupply } from '@/components/TokenAggregateSupply'
import { useStartIndexer } from '@/hooks/useIndexer'
import { Button } from '@/components/ui/button'
import { RecentActivity } from '@/components/RecentActivity'

const IndexerStarter = () => {
const indexer = useStartIndexer();
const indexer = useStartIndexer()
return (
<Button
variant="outline"
Expand All @@ -26,19 +24,18 @@ const IndexerStarter = () => {
<RefreshCw className="h-4 w-4" />
Reset Indexer
</Button>
);
)
}

function App() {
return (
<Providers>

<div className="min-h-screen bg-slate-50 dark:bg-slate-950">
<header className="border-b">
<div className="container mx-auto flex h-16 items-center justify-between">
<h1 className="text-xl font-bold">SuperchainERC20 Dev Tools</h1>
<div className="flex items-center gap-4">
<IndexerStarter />
<IndexerStarter />
<ConnectWalletButton />
</div>
</div>
Expand All @@ -60,7 +57,7 @@ function App() {
<Tabs defaultValue="faucet" className="w-full">
<div className="px-6 pt-6">
<TabsList className="w-full flex">
<TabsTrigger value="faucet" className="flex-1">
<TabsTrigger value="faucet" className="flex-1">
<Droplet className="mr-2 h-4 w-4" />
Faucet
</TabsTrigger>
Expand All @@ -70,7 +67,7 @@ function App() {
</TabsTrigger>
</TabsList>
</div>

<div className="p-6">
<TabsContent value="bridge">
<Bridge />
Expand All @@ -80,16 +77,19 @@ function App() {
</TabsContent>
<TabsContent value="deploy">
{/* Add Contract Deployment interface */}
<div className="text-muted-foreground">Contract deployment interface coming soon...</div>
<div className="text-muted-foreground">
Contract deployment interface coming soon...
</div>
</TabsContent>
<TabsContent value="verify">
{/* Add Contract Verification interface */}
<div className="text-muted-foreground">Contract verification interface coming soon...</div>
<div className="text-muted-foreground">
Contract verification interface coming soon...
</div>
</TabsContent>
</div>
</Tabs>
</Card>

</div>

<div className="space-y-6">
Expand All @@ -99,7 +99,7 @@ function App() {
</main>
</div>
</Providers>
);
)
}

export default App;
export default App
Loading

0 comments on commit 0a3011a

Please sign in to comment.