Skip to content

Commit

Permalink
Add minimal viable Anchor (#602)
Browse files Browse the repository at this point in the history
* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* Added happy ever after

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

* WIP

Signed-off-by: chrismaree <[email protected]>

---------

Signed-off-by: chrismaree <[email protected]>
  • Loading branch information
chrismaree committed Sep 17, 2024
1 parent 6c9d5b6 commit 5c779a9
Show file tree
Hide file tree
Showing 76 changed files with 2,685 additions and 525 deletions.
106 changes: 70 additions & 36 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,105 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
node:
- 20
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Use Node ${{ matrix.node }}
- name: "Use Node ${{ matrix.node }}"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
node-version: "${{ matrix.node }}"
cache: yarn
- name: Setup Anchor & Build
uses: metadaoproject/setup-anchor@v2
with:
anchor-version: 0.30.1
solana-cli-version: 1.18.21
node-version: 20
- name: Create keypair
run: solana-keygen new --no-bip39-passphrase
shell: bash
- name: Install Cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustc
- name: Install packages
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Lint js
shell: bash
run: yarn lint-js
- name: Lint solidity
shell: bash
run: yarn lint-solidity
- name: Lint rust
shell: bash
run: yarn lint-rust
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
node:
- 20
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Use Node ${{ matrix.node }}
- name: "Use Node ${{ matrix.node }}"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
node-version: "${{ matrix.node }}"
cache: yarn
- name: Setup Anchor & Build
uses: metadaoproject/setup-anchor@v2
with:
anchor-version: 0.30.1
solana-cli-version: 1.18.21
node-version: 20
- name: Create keypair
run: solana-keygen new --no-bip39-passphrase
shell: bash
- name: Install Cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustc
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Install packages
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Test
run: yarn test
- name: Test evm-hardhat
shell: bash
run: yarn test-evm
- name: Test svm
shell: bash
run: yarn test-svm
forge:
name: Forge
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
node:
- 20
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Use Node ${{ matrix.node }}
- name: "Use Node ${{ matrix.node }}"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
node-version: "${{ matrix.node }}"
cache: yarn
- name: Setup Anchor & Build
uses: metadaoproject/setup-anchor@v2
with:
anchor-version: 0.30.1
solana-cli-version: 1.18.21
node-version: 20
- name: Install packages
run: yarn install --frozen-lockfile
- name: Install Foundry
Expand All @@ -61,23 +113,5 @@ jobs:
run: forge install
- name: Inspect storage layouts
run: ./scripts/checkStorageLayout.sh
- name: Run forge test
run: forge test --match-path test/foundry/local/**/*.t.sol
solhint:
name: Solhint
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
- name: Install packages
run: yarn install --frozen-lockfile
- name: Solhint
run: yarn lint-contracts
- name: Test evm-foundry
run: forge test --match-path test/evm/foundry/local/**/*.t.sol
9 changes: 8 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ jobs:
- name: Validate and extract release information
id: release
uses: manovotny/[email protected]

# Setup Anchor to enable compilation and export of Solana programs
- name: Setup Anchor & Build
- uses: metadaoproject/setup-anchor@v2
with:
anchor-version: "0.30.1"
solana-cli-version: "1.18.21"
node-version: "20.17.0"
- run: anchor build
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ coverage.json
typechain
dist
typechain-types
.DS_Store
.yarn

# Vim files
*.swp
Expand All @@ -23,3 +25,9 @@ storage-layouts/proposed*

# IDE
.idea

# Anchor files
.anchor
target
**/*.rs.bk
test-ledger
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dist
artifacts-zk
cache-zk
lib
target
18 changes: 18 additions & 0 deletions Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[toolchain]

[features]
resolution = true
skip-lint = false

[programs.localnet]
testacross = "E4dpZS9P24pscXvPngpeUhrR98uZYMfi3VMLnLaYDA6b"

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 test/svm/**/*.ts"
Loading

0 comments on commit 5c779a9

Please sign in to comment.