Skip to content

Commit

Permalink
Merge pull request #487 from 0xsend/mvp
Browse files Browse the repository at this point in the history
mvp! mvp! mvp!
  • Loading branch information
0xBigBoss authored Jun 27, 2024
2 parents 6d9e6b2 + 2087a75 commit 2412c5b
Show file tree
Hide file tree
Showing 441 changed files with 31,880 additions and 15,073 deletions.
47 changes: 24 additions & 23 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
*
!package.json
!.yarnrc.yml
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!yarn.lock
!foundry.toml
!remappings.txt
!tsconfig.json
!tsconfig.base.json
!apps
!packages
!supabase/package.json
!supabase/tsconfig.json
!supabase/*.types.ts
# may be redundant but last thing we want is large dockerfiles. from here on out, it mostly mirrors the .gitignore
**/Tiltfile
**/**.tiltfile
**/**.Tiltfile
**/*.tsbuildinfo
**/dist
**/node_modules
**/out
**/.tamagui/*
**/coverage
**/.next
**/.expo
/build
**/build
**/test-results
**/playwright-report
.cache/
**/.next
**/.expo
**/.auth
**/.tamagui/*
**/coverage
**/.turbo
**/.cache/
**/out
**/*.snap
.auth/

*.log*
Expand Down Expand Up @@ -65,6 +59,13 @@ tmp
.parcel-cache

# Foundry stuff
cache/
out/
broadcast
**/cache/
**/out/
**/var
**/broadcast
!**/broadcast/**/run-latest.json
**/Dockerfile
**/.dockerignore
**/.tamagui
.watchman**
**/vitest.config.ts.timestamp**
2 changes: 2 additions & 0 deletions .env.development.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CI=true
DEBUG=api:*
5 changes: 3 additions & 2 deletions .env.local.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ NEXT_PUBLIC_MAINNET_CHAIN_ID=1337
NEXT_PUBLIC_BASE_CHAIN_ID=845337
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=33fe0df7cd4f445f4e2ba7e0fd6ed314
SNAPLET_HASH_KEY=sendapp
SEND_ACCOUNT_FACTORY_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
SECRET_SHOP_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
SEND_ACCOUNT_FACTORY_PRIVATE_KEY=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
SECRET_SHOP_PRIVATE_KEY=0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a
# NEXT_PUBLIC_ENABLE_QUERY_DEV_TOOLS=1
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
dotenv_if_exists .env
dotenv_if_exists .env.local
source_env_if_exists .envrc.private
layout node
54 changes: 54 additions & 0 deletions .github/actions/docker-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Setup Docker Build Environment"
description: "Set up Node.js, install Foundry, and set up Bun. Runs Yarn install run docker build"
inputs:
build-nextjs-docker:
description: "Whether to build Next.js docker image"
required: false
default: "true"
push-nextjs-docker-image:
description: "Whether to push build to dockerhub"
required: false
default: "false"
dockerhub_username:
description: "Username to login to dockerhub"
required: false
dockerhub_password:
description: "Password to login to dockerhub"
required: false
runs:
using: "composite"
steps:
- name: Use Node.js
if: ${{ inputs.build-nextjs-docker == 'true' }}
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: "yarn"
- name: Setup Bun
if: ${{ inputs.build-nextjs-docker == 'true' }}
uses: oven-sh/setup-bun@v1
- name: Install Foundry
if: ${{ inputs.build-nextjs-docker == 'true' }}
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Yarn Install
if: ${{ inputs.build-nextjs-docker == 'true' }}
shell: bash
run: yarn install --immutable
- name: Build Next.js
if: ${{ inputs.build-nextjs-docker == 'true' }}
shell: bash
run: |
cp .env.local.template .env.local
yarn web:docker:build
rm .env.local
- uses: docker/login-action@v3
if: ${{ inputs.build-nextjs-docker == 'true' }} && ${{ inputs.push-nextjs-docker-image == 'true' }}
with:
username: ${{ inputs.dockerhub_username }}
password: ${{ inputs.dockerhub_password }}
- name: Push to dockerhub
shell: bash
if: ${{ inputs.build-nextjs-docker == 'true' }} && ${{ inputs.push-nextjs-docker-image == 'true' }}
run: yarn web:docker:push
25 changes: 25 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docker Build
on:
pull_request:
types:
- closed
branches:
- 'releases/**'
- 'dev'
- 'main'
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
# needs: [cache-deps]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build & Push Docker Image for next-app
uses: ./.github/actions/docker-build
with:
build-nextjs-docker: true
push-nextjs-docker-image: true
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_TOKEN }}
33 changes: 32 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
env:
YARN_ENABLE_HARDENED_MODE: 0
SKIP_YARN_POST_INSTALL: 1
- name: Build
run: yarn build
- name: Lint
run: yarn lint

Expand Down Expand Up @@ -107,6 +109,10 @@ jobs:
ANVIL_BASE_FORK_URL: ${{ secrets.CI_ANVIL_BASE_FORK_URL }}
YARN_ENABLE_HARDENED_MODE: 0

# for writing PR comments
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -160,7 +166,7 @@ jobs:
sleep 1
echo tilt is ready
max_attempts=60
wait_timeout=5
wait_timeout=7
for ((i=1; i<=max_attempts; i++)); do
echo "Attempt $i: Waiting for tilt with timeout ${wait_timeout}s"
Expand All @@ -182,6 +188,24 @@ jobs:
fi
done
yarn playwright test
- name: Playwright Markdown Report
if: always() && steps.playwright.outcome != 'skipped'
id: playwright-md-report
shell: bash
run: |
echo "Markdown report:"
echo "------------------"
bun run packages/playwright/bin/report-markdown.ts > playwright-report.md
cat playwright-report.md
echo "------------------"
echo "Markdown report end"
- uses: mshick/add-pr-comment@v2
if: always() && steps.playwright.outcome != 'skipped'
with:
message-id: playwright-report
refresh-message-position: true
message-path: |
playwright-report.md
- name: Tilt Down
# always run tilt down if tilt ci started
if: always() && steps.playwright.outcome != 'skipped'
Expand All @@ -194,6 +218,13 @@ jobs:
name: playwright-report
path: packages/playwright/playwright-report/
retention-days: 30
- name: Playwright Test Results
uses: actions/upload-artifact@v4
if: always() && steps.playwright.outcome == 'failure'
with:
name: playwright-test-results
path: packages/playwright/test-results/
retention-days: 30

vercel-deploy-preview:
# **always** skip if on dev and main since it will be deployed with another workflow
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ tmp

# ignore for now
Brewfile.lock.json

# asdf
.tool-versions
Loading

0 comments on commit 2412c5b

Please sign in to comment.