Skip to content

Commit

Permalink
chore: reorg workflows (#314)
Browse files Browse the repository at this point in the history
* put tests and static checks in individual workflow files

* add common tasks for linting and cycle detection

* move prettier setup to root

* update prettier setup

* fix format in repo

* pull cspell config to the root

* fix spelling issues

* remove obsolete scripts

* add missing scripts

* split out e2e tests
  • Loading branch information
frontendphil authored Dec 11, 2024
1 parent 5a15a5d commit d2730f9
Show file tree
Hide file tree
Showing 161 changed files with 615 additions and 609 deletions.
35 changes: 24 additions & 11 deletions extension/.cspell.json → .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
"ccip",
"cctp",
"Checksummed",
"Chromewebstore",
"connectkit",
"cowswap",
"Delegatecall",
"delegatecalls",
"depay",
"esbuild",
"ethersproject",
"extralight",
"foundance",
"getsourcecode",
"gnosisguild",
Expand All @@ -40,9 +43,11 @@
"lucide",
"mastercopy",
"metavault",
"middlewares",
"multicall",
"multisend",
"Numberish",
"nums",
"oeth",
"Omni",
"omnibridge",
Expand Down Expand Up @@ -73,11 +78,15 @@
"Stakewise",
"Sushiswap",
"tailwindcss",
"tanstack",
"textbox",
"toastify",
"TTFB",
"Uids",
"UNWRAPPER",
"viem",
"vnet",
"Wagmi",
"walletconnect",
"whatsabi",
"xcall",
Expand All @@ -86,18 +95,22 @@
],
"flagWords": [],
"ignorePaths": [
"package.json",
"pnpm-lock.yaml",
"node_modules/**",
"tsconfig.json",
"esbuild.js",
"tailwind.config.js",
"public/build/**",
"public/_metadata/**",
"playwright-report/**",
"**/package.json",
"**/pnpm-lock.yaml",
"**/node_modules/**",
"**/walletconnect.db/**",
"**/tsconfig.json",
"**/renovate.json",
"**/esbuild.js",
"**/tailwind.config.js",
"**/tailwind.config.ts",
"**/dist/**",
"**/public/build/**",
"**/public/_metadata/**",
"**/playwright-report/**",
"**/*.svg",
"patches/**",
"test-utils/**",
"**/patches/**",
"**/test-utils/**",
"**/*.sh"
]
}
62 changes: 0 additions & 62 deletions .github/workflows/ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Playwright Tests
name: Live Tests

on:
deployment_status:

jobs:
test:
playwright-e2e:
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
Expand All @@ -15,8 +17,8 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: latest
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install dependencies
run: pnpm install --prefer-offline

Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Static Checks

on:
pull_request:
push:
branches:
- main

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --prefer-offline
- name: Typecheck
run: pnpm check-types

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --prefer-offline
- name: Typecheck
run: pnpm lint

check-cycles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --prefer-offline
- name: Typecheck
run: pnpm check-cycles

check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --prefer-offline
- name: Typecheck
run: pnpm check-format

check-spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --prefer-offline
- name: Typecheck
run: pnpm check-spelling
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests

on:
pull_request:
push:
branches:
- main

jobs:
unit_tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./extension
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --prefer-offline
- run: pnpm test:unit
- name: 'Report Coverage'
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: extension
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
playwright-report

*.zip
*.toml
*.patch
2 changes: 1 addition & 1 deletion extension/.prettierrc.cjs → .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'es5',
trailingComma: 'all',
plugins: [
// eslint-disable-next-line no-undef
require.resolve('prettier-plugin-organize-imports'),
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ A big welcome and thank you for considering contributing to Gnosis Guild's open

Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the time of the developers managing and developing these open source projects. In return, we will reciprocate that respect by addressing your issues, assessing changes, and helping you finalize your pull requests.

## Quicklinks
## Quick links

- [Contributing to Gnosis Guild Projects](#contributing-to-gnosis-guild-projects)
- [Quicklinks](#quicklinks)
- [Quick links](#quick-links)
- [CLA](#cla)
- [Code of Conduct](#code-of-conduct)
- [Getting Started](#getting-started)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://github.com/gnosisguild/zodiac-pilot/actions/workflows/ci.yml/badge.svg)](https://github.com/gnosiguild/zodiac-pilot/actions/workflows/ci.yml)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](https://github.com/gnosiguild/CODE_OF_CONDUCT)

Chrome extension to simulate Dapp interactions and record transactions. [Available on the Chrome Webstore](https://chrome.google.com/webstore/detail/zodiac-pilot/jklckajipokenkbbodifahogmidkekcb?hl=en&authuser=0)
Chrome extension to simulate Dapp interactions and record transactions. [Available on the Chrome Web Store](https://chrome.google.com/webstore/detail/zodiac-pilot/jklckajipokenkbbodifahogmidkekcb?hl=en&authuser=0)

## Contribute

Expand Down
2 changes: 1 addition & 1 deletion connect/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<head>
<meta charset="utf-8" />
<meta
Expand Down
5 changes: 0 additions & 5 deletions example-app/.prettierrc

This file was deleted.

3 changes: 0 additions & 3 deletions example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
"@types/react": "^18.3.10",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "^4.1.0",
"prettier-plugin-tailwindcss": "^0.6.8",
"tailwindcss": "^3.4.13",
"vite": "^5.4.8",
"vite-tsconfig-paths": "^5.0.1"
Expand Down
20 changes: 10 additions & 10 deletions example-app/server.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { createRequestHandler } from "@remix-run/express"
import express from "express"
import { createRequestHandler } from '@remix-run/express'
import express from 'express'

const viteDevServer =
process.env.NODE_ENV === "production"
process.env.NODE_ENV === 'production'
? null
: await import("vite").then((vite) =>
: await import('vite').then((vite) =>
vite.createServer({
server: { middlewareMode: true },
})
}),
)

const app = express()
app.use(
viteDevServer ? viteDevServer.middlewares : express.static("build/client")
viteDevServer ? viteDevServer.middlewares : express.static('build/client'),
)

const build = viteDevServer
? () => viteDevServer.ssrLoadModule("virtual:remix/server-build")
: await import("./build/server/index.js")
? () => viteDevServer.ssrLoadModule('virtual:remix/server-build')
: await import('./build/server/index.js')

// and your app is "just a request handler"
app.all("*", createRequestHandler({ build }))
app.all('*', createRequestHandler({ build }))

app.listen(3030, () => {
console.log("App listening on http://localhost:3030")
console.log('App listening on http://localhost:3030')
})
6 changes: 3 additions & 3 deletions example-app/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Config } from "tailwindcss";
import type { Config } from 'tailwindcss'

export default {
content: ["./app/**/*.tsx"],
content: ['./app/**/*.tsx'],
theme: {
extend: {},
},
plugins: [],
} satisfies Config;
} satisfies Config
2 changes: 0 additions & 2 deletions extension/.prettierignore

This file was deleted.

2 changes: 1 addition & 1 deletion extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const { mockedTab, mockedPort } = await render(
],
// You can pass any subset of attributes for a tab
// and `render` fills in the other ones with defaults
{ activeTab: { id: 'tab-id' } }
{ activeTab: { id: 'tab-id' } },
)

// Rendering only finishes when there is actual UI visible
Expand Down
Loading

0 comments on commit d2730f9

Please sign in to comment.