Skip to content

Commit

Permalink
Merge pull request #1 from axieinfinity/setup
Browse files Browse the repository at this point in the history
feat: separate the Bridge smart contracts from DPOS smart contracts
  • Loading branch information
ducthotran2010 authored Nov 23, 2023
2 parents f301e1a + 2b3192d commit 2c628f0
Show file tree
Hide file tree
Showing 521 changed files with 1,690 additions and 34,684 deletions.
14 changes: 0 additions & 14 deletions .env.example

This file was deleted.

2 changes: 2 additions & 0 deletions .github/template/create-pull-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Description
PR to merge from [{{ .fromBranch }}](/axieinfinity/rns-contracts/tree/{{ .fromBranch }}) to [{{ .toBranch }}](/axieinfinity/rns-contracts/tree/{{ .toBranch }}).
51 changes: 51 additions & 0 deletions .github/workflows/create-PR-implement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create Pull Request From Implement To Feature
on:
push:
branches:
- 'implement-feature/**'
- 'implement-feature/**/**'

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

env:
HEAD_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
createPullRequest:
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "FEATURE_NAME=$(echo ${HEAD_BRANCH} | cut -d'/' -f2)" >> $GITHUB_ENV
echo "FEATURE_BRANCH=feature/$(echo ${HEAD_BRANCH} | cut -d'/' -f2)" >> $GITHUB_ENV
echo "IMPLEMENT_NAME=$(echo ${HEAD_BRANCH} | cut -d'/' -f3)" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: ${{env.FEATURE_BRANCH}}

- name: Reset promotion branch
run: |
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH}
git reset --hard ${HEAD_BRANCH}
- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
template: .github/template/create-pull-request.md
vars: |
fromBranch: ${{env.HEAD_BRANCH}}
toBranch: ${{ env.FEATURE_BRANCH }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: ${{ env.HEAD_BRANCH }}
base: ${{env.FEATURE_BRANCH}}
labels: automated PR
team-reviewers: axieinfinity/smart-contract
title: 'feat(${{env.FEATURE_NAME}}): implement `${{env.IMPLEMENT_NAME}}`'
body: ${{ steps.template.outputs.result }}
245 changes: 245 additions & 0 deletions .github/workflows/create-PR-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
name: Create Pull Request From Release to Feature
on:
push:
branches:
- 'release/*'
- 'release*/*'

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

env:
HEAD_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
mergeRelease2FeatureRnsUnified:
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "PR_BRANCH=merge/${HEAD_BRANCH}-feature/rns-unified" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: feature/rns-unified
- name: Reset promotion branch
run: |
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH}
git reset --hard ${HEAD_BRANCH}
- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
template: .github/template/create-pull-request.md
vars: |
fromBranch: ${{env.HEAD_BRANCH}}
toBranch: feature/rns-unified
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
labels: automated PR
team-reviewers: axieinfinity/smart-contract
delete-branch: true
title: 'chore(rns-unified): merge from `${{env.HEAD_BRANCH}}`'
body: ${{ steps.template.outputs.result }}
branch: ${{env.PR_BRANCH}}

mergeRelease2FeatureController:
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "PR_BRANCH=merge/${HEAD_BRANCH}-feature/controller" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: feature/controller
- name: Reset promotion branch
run: |
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH}
git reset --hard ${HEAD_BRANCH}
- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
template: .github/template/create-pull-request.md
vars: |
fromBranch: ${{env.HEAD_BRANCH}}
toBranch: feature/controller
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
labels: automated PR
team-reviewers: axieinfinity/smart-contract
delete-branch: true
title: 'chore(controller): merge from `${{env.HEAD_BRANCH}}`'
body: ${{ steps.template.outputs.result }}
branch: ${{env.PR_BRANCH}}

mergeRelease2FeatureDomainPrice:
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "PR_BRANCH=merge/${HEAD_BRANCH}-feature/domain-price" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: feature/domain-price
- name: Reset promotion branch
run: |
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH}
git reset --hard ${HEAD_BRANCH}
- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
template: .github/template/create-pull-request.md
vars: |
fromBranch: ${{env.HEAD_BRANCH}}
toBranch: feature/domain-price
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
labels: automated PR
team-reviewers: axieinfinity/smart-contract
delete-branch: true
title: 'chore(domain-price): merge from `${{env.HEAD_BRANCH}}`'
body: ${{ steps.template.outputs.result }}
branch: ${{env.PR_BRANCH}}

mergeRelease2FeatureAuction:
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "PR_BRANCH=merge/${HEAD_BRANCH}-feature/auction" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: feature/auction
- name: Reset promotion branch
run: |
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH}
git reset --hard ${HEAD_BRANCH}
- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
template: .github/template/create-pull-request.md
vars: |
fromBranch: ${{env.HEAD_BRANCH}}
toBranch: feature/auction
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
labels: automated PR
team-reviewers: axieinfinity/smart-contract
delete-branch: true
title: 'chore(auction): merge from `${{env.HEAD_BRANCH}}`'
body: ${{ steps.template.outputs.result }}
branch: ${{env.PR_BRANCH}}

mergeRelease2FeaturePublicResolver:
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "PR_BRANCH=merge/${HEAD_BRANCH}-feature/public-resolver" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: feature/public-resolver
- name: Reset promotion branch
run: |
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH}
git reset --hard ${HEAD_BRANCH}
- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
template: .github/template/create-pull-request.md
vars: |
fromBranch: ${{env.HEAD_BRANCH}}
toBranch: feature/public-resolver
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
labels: automated PR
team-reviewers: axieinfinity/smart-contract
delete-branch: true
title: 'chore(public-resolver): merge from `${{env.HEAD_BRANCH}}`'
body: ${{ steps.template.outputs.result }}
branch: ${{env.PR_BRANCH}}

mergeRelease2FeatureCI:
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "PR_BRANCH=merge/${HEAD_BRANCH}-feature/ci" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: feature/ci
- name: Reset promotion branch
run: |
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH}
git reset --hard ${HEAD_BRANCH}
- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
template: .github/template/create-pull-request.md
vars: |
fromBranch: ${{env.HEAD_BRANCH}}
toBranch: feature/ci
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
labels: automated PR
team-reviewers: axieinfinity/smart-contract
delete-branch: true
title: 'chore(ci): merge from `${{env.HEAD_BRANCH}}`'
body: ${{ steps.template.outputs.result }}
branch: ${{env.PR_BRANCH}}

mergeRelease2FeatureReverseRegistrar:
runs-on: ubuntu-latest
steps:
- name: Set env
run: |
echo "PR_BRANCH=merge/${HEAD_BRANCH}-feature/reverse-registrar" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: feature/reverse-registrar
- name: Reset promotion branch
run: |
git fetch origin ${HEAD_BRANCH}:${HEAD_BRANCH}
git reset --hard ${HEAD_BRANCH}
- name: Render template
id: template
uses: chuhlomin/[email protected]
with:
template: .github/template/create-pull-request.md
vars: |
fromBranch: ${{env.HEAD_BRANCH}}
toBranch: feature/reverse-registrar
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
labels: automated PR
team-reviewers: axieinfinity/smart-contract
delete-branch: true
title: 'chore(reverse-registrar): merge from `${{env.HEAD_BRANCH}}`'
body: ${{ steps.template.outputs.result }}
branch: ${{env.PR_BRANCH}}
50 changes: 21 additions & 29 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,45 @@ on:
branches:
- mainnet
- testnet
- "release/**"
- 'feature/*'
- 'features/*'
pull_request:
branches:
- main
- mainnet
- testnet
- "release/**"
- 'feature/*'
- 'features/*'

permissions:
contents: read
packages: read

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
nodejs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- name: "Checkout Repo"
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.0.2
- uses: actions/checkout@v4
with:
submodules: recursive

- name: "Setup Node"
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 #v3.4.1
with:
node-version: v16.16.0

- name: Github private package token in npmrc
run: |
echo "@axieinfinity:registry=https://npm.pkg.github.com/" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
- name: "Run install"
uses: borales/actions-yarn@97ba8bebfe5b549bb7999261698a52a81fd62f1b #v4.2.0
with:
cmd: install

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@cb603ca0abb544f301eaed59ac0baf579aa6aecf #v1.0.10

- name: "Run Compile"
uses: borales/actions-yarn@97ba8bebfe5b549bb7999261698a52a81fd62f1b #v4.2.0
with:
cmd: compile
- name: Run Forge build
run: |
forge --version
forge build --names
id: build

- name: "Run Test"
uses: borales/actions-yarn@97ba8bebfe5b549bb7999261698a52a81fd62f1b #v4.2.0
with:
cmd: test:ci
- name: Run Forge tests
run: |
forge test --no-match-path '*forking/*' -vvv
id: test
Loading

0 comments on commit 2c628f0

Please sign in to comment.