Skip to content

Commit

Permalink
ci: Add Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
isidroamv committed Nov 29, 2023
1 parent a6d49c1 commit 9d0961b
Show file tree
Hide file tree
Showing 10 changed files with 204 additions and 508 deletions.
81 changes: 0 additions & 81 deletions .circleci/config.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on: [push]
jobs:
run_twitter_circuit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install Yarn dependencies
working-directory: ./packages/circuits
run: yarn install --immutable
- name: Run Tests
run: forge test --root ./packages/contracts --fork-url https://eth-goerli.g.alchemy.com/v2/${{vars.ALCHEMY_API_KEY}}

run_unit_and_e2e_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
- name: Install Yarn dependencies
working-directory: ./packages/app
run: yarn install
- name: Run test
working-directory: ./packages/app
run: yarn test
- name: Run build
working-directory: ./packages/app
run: yarn build
- name: E2E Test Code
uses: mujo-code/[email protected]
env:
CI: "true"
with:
args: yarn workspace @zk-email/twitter-verifier test:full-e2e

17 changes: 17 additions & 0 deletions packages/app/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
33 changes: 33 additions & 0 deletions packages/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="manifest" href="/manifest.json" />
<title>ZK Email</title>

<script>
window.global = window;
</script>

<script type="module">
import { Buffer } from "buffer";
import process from "process";

window.Buffer = Buffer;
window.process = process;
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script type="module" src="./index.tsx"></script>
</body>
</html>
7 changes: 5 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
},
"scripts": {
"start": "vite",
"build": "yarn g:tsc && vite build",
"build": "yarn tsc && vite build",
"serve": "vite preview",
"test": "jest --runInBand --testPathIgnorePatterns='e2e' --reporters=default --reporters=jest-junit",
"start-e2e-test-server": "serve -s dist -p 3000",
"test:e2e-ui": "CI=true jest ./tests/e2e-ui*.test.*",
"test:full-e2e": "bash scripts/test-e2e.sh",
"test:e2e-zkp": "CI=true jest ./tests/e2e-dl-zkp.test.ts"
},
"eslintConfig": {
Expand All @@ -56,6 +57,7 @@
]
},
"devDependencies": {
"@babel/preset-react": "^7.23.3",
"@types/atob": "^2.1.2",
"@types/jest": "^29.5.1",
"@types/lodash": "^4.14.181",
Expand All @@ -76,14 +78,15 @@
"puppeteer": "18.1",
"rollup-plugin-node-polyfills": "^0.2.1",
"selenium-webdriver": "^4.8.1",
"typescript": "^5.3.2",
"vite-plugin-commonjs": "^0.7.1",
"vite-plugin-ngmi-polyfill": "^0.0.2",
"vite-plugin-node-polyfills": "^0.8.2",
"vite-tsconfig-paths": "^4.2.0"
},
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!@rainbow-me/rainbowkit)"
"node_modules/(?!@rainbow-me/rainbowkit|@zk-email|ffjavascript)"
],
"testEnvironment": "jsdom",
"setupFilesAfterEnv": [
Expand Down
5 changes: 5 additions & 0 deletions packages/app/scripts/test-e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# Execute E2E test
# This file is required in the CI
yarn start-e2e-test-server & yarn test:e2e-ui
2 changes: 2 additions & 0 deletions packages/app/tests/e2e-ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ describe("App.js", () => {
beforeAll(async () => {
browser = await puppeteer.launch({
// headless: true,
args: ['--no-sandbox'],
executablePath: process.env.PUPPETEER_EXEC_PATH,
headless: false,
slowMo: 100
});
Expand Down
3 changes: 1 addition & 2 deletions packages/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"esModuleInterop": true,
"target": "es2022",
"isolatedModules": true,
"strict": true,
"noEmit": true
"strict": true
}
}
2 changes: 0 additions & 2 deletions packages/circuits/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
"@zk-email/circuits": "^3.2.0",
"@zk-email/contracts": "^5.0.0",
"@zk-email/helpers": "^3.0.2",
"@zk-email/zk-regex-apis": "^1.1.6",
"@zk-email/zk-regex-circom": "^1.1.1",
"@zk-email/zk-regex-compiler": "^1.0.7",
"commander": "^11.1.0",
"snarkjs": "git+https://github.com/vb7401/snarkjs.git#24981febe8826b6ab76ae4d76cf7f9142919d2b8"
},
Expand Down
Loading

0 comments on commit 9d0961b

Please sign in to comment.