Skip to content
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

chore: restore code #5

Merged
merged 9 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = double

[*.md]
trim_trailing_whitespace = false
max_line_length = 80
indent_size = 2
26 changes: 26 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"targets": {
"zksync-auth-server-staging": {
"hosting": {
"zksync-auth-server-staging": [
"zksync-auth-server-staging"
]
}
},
"stake-demo-app": {
"hosting": {
"stake-demo-app": [
"stake-demo-app"
]
}
},
"nft-quest-testnet": {
"hosting": {
"nft-quest-testnet": [
"nft-quest-testnet"
]
}
}
},
"etags": {}
}
60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Bug report
description: File a bug report to help us improve
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please fill out as much as you can, the more details the better we can help to resolve the issue.
- type: dropdown
id: project
attributes:
label: 🧰 Project
description: Which project is this bug related to?
options:
- Contracts
- Auth Server
- SDK
- Examples
default: 0
validations:
required: true
- type: textarea
id: description
attributes:
label: 📝 Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: steps
attributes:
label: 🔄 Reproduction steps
description: Steps to reproduce the behavior.
- type: textarea
id: expected
attributes:
label: 🤔 Expected behavior
description: What did you expect to happen.
- type: textarea
id: actual
attributes:
label: 😯 Actual behavior
description: What actually happened.
- type: textarea
id: environment
attributes:
label: 🖥 Environment
description: Please provide relevant details about the environment you experienced the bug in.
- type: textarea
id: additional
attributes:
label: 📋 Additional context
description: Add any other context about the problem here. If applicable, add screenshots to help explain.
- type: textarea
id: logs
attributes:
label: 📎 Logs
description: If applicable, add logs to help explain the problem.
render: shell
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Feature request
description: Suggest an idea for this project
title: "[Request]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request! Please fill out as much as you can, the more details the better we can help to implement the feature.
- type: textarea
id: description
attributes:
label: 📝 Description
description: A clear and concise description of what the feature is.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: 🤔 Rationale
description: Why do you think this feature is important and how will it benefit the project?
- type: textarea
id: additional
attributes:
label: 📋 Additional context
description: Add any other context or information about the feature request here.
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Description



## Additional context
169 changes: 169 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: CI

on:
pull_request:
workflow_dispatch:

jobs:
e2e-demo-app:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: recursive

# Start node
- name: Era Test Node Action
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: lts/Iron
cache: pnpm

# Install dependencies for repo
- name: Install dependencies
run: pnpm install -r --frozen-lockfile

# Install dependencies for the submodule
- name: Install contract dependencies
run: pnpm install -r --frozen-lockfile
working-directory: packages/contracts

- name: Build SDK
run: pnpm nx build sdk

- name: Build contracts
run: pnpm build
working-directory: packages/contracts

- name: Deploy contracts
run: pnpm run deploy
working-directory: packages/contracts

# Run E2E tests
- name: Install Playwright Chromium Browser
run: pnpm exec playwright install chromium
working-directory: examples/demo-app
- name: Run e2e tests
run: pnpm nx e2e demo-app
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: demo-app-playwright-report
path: examples/demo-app/playwright-report/
retention-days: 3


e2e-nft-quest:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: recursive

# Start node
- name: Era Test Node Action
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: lts/Iron
cache: pnpm

# Install dependencies for repo
- name: Install dependencies
run: pnpm install -r --frozen-lockfile

# Install dependencies for the submodule
- name: Install contract dependencies
run: pnpm install -r --frozen-lockfile
working-directory: packages/contracts

- name: Build SDK
run: pnpm nx build sdk

- name: Build contracts
run: pnpm build
working-directory: packages/contracts

- name: Deploy contracts
run: pnpm run deploy
working-directory: packages/contracts

- name: Deploy NFT contracts
run: pnpm nx deploy:local nft-quest-contracts

# Run E2E tests
- name: Install Playwright Chromium Browser
run: pnpm exec playwright install chromium
working-directory: examples/nft-quest
- name: Run e2e tests
run: pnpm nx e2e nft-quest
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: nft-quest-playwright-report
path: examples/nft-quest/playwright-report/
retention-days: 3


contracts:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: recursive

# Start node
- name: Era Test Node Action
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1

# Setup pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: lts/Iron
cache: pnpm

# Install dependencies for the submodule
- name: Install contract dependencies
run: pnpm install -r --frozen-lockfile
working-directory: packages/contracts

# Build contracts and generate types
- name: Build contracts
run: pnpm build
working-directory: packages/contracts

# Run contract tests
- name: Run contract test
run: pnpm test
working-directory: packages/contracts

46 changes: 46 additions & 0 deletions .github/workflows/deploy-auth-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Deploy Auth Server Testnet"
on:
push:
branches: [ "main" ]
paths:
- "packages/auth-server/**"
- "packages/sdk/**"
workflow_dispatch:

env:
HUSKY: 0
CI: true

jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/Iron
cache: 'pnpm'

- name: Install dependencies
run: pnpm install -r --frozen-lockfile

- name: Build apps
env:
NUXT_PUBLIC_DEFAULT_CHAIN_ID: 300
run: pnpm nx build auth-server

- name: Deploy firebase hosting
uses: matter-labs/action-hosting-deploy@main
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_AUTH_SERVER_STAGING }}"
projectId: zksync-auth-server-staging
target: zksync-auth-server-staging
channelId: live
44 changes: 44 additions & 0 deletions .github/workflows/deploy-nft-quest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Deploy NFT Quest Testnet"
on:
push:
branches: [ "main" ]
paths:
- "examples/nft-quest/**"
- "packages/sdk/**"
workflow_dispatch:

env:
HUSKY: 0
CI: true

jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/Iron
cache: 'pnpm'

- name: Install dependencies
run: pnpm install -r --frozen-lockfile

- name: Build apps
run: pnpm nx build nft-quest

- name: Deploy firebase hosting
uses: matter-labs/action-hosting-deploy@main
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: "${{ secrets.FIREBASE_NFT_QUEST_TESTNET }}"
projectId: nft-quest-testnet
target: nft-quest-testnet
channelId: live
Loading