Skip to content

Commit

Permalink
Initial commit for Solana Anchor RustRover template
Browse files Browse the repository at this point in the history
  • Loading branch information
mars-arch committed Oct 10, 2024
0 parents commit 3ce7630
Show file tree
Hide file tree
Showing 30 changed files with 549 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[build]
target = "x86_64-unknown-linux-gnu"

[term]
verbose = true

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-cpu=native", "-C", "opt-level=3"]

[profile.release]
debug = true
lto = true
opt-level = "z"
8 changes: 8 additions & 0 deletions .cargo_generate.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[template]
description = "A Solana Anchor project template optimized for IntelliJ RustRover"
version = "0.1.0"
repository = "https://github.com/mars-arch/solana-anchor-rustrover-template"

[placeholders]
project-name = { type = "string", prompt = "Enter the project name" }
authors = { type = "string", prompt = "Enter the author name(s)" }
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Solana Anchor CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: Build and Test Solana Anchor Program
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Set up Rust environment
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy

# Install Solana CLI tools
- name: Install Solana CLI
run: |
sh -c "$(curl -sSfL https://release.solana.com/v1.10.31/install)"
# Install Anchor CLI
- name: Install Anchor
run: |
cargo install --git https://github.com/coral-xyz/anchor anchor-cli --locked
# Build the Anchor program
- name: Build Anchor program
run: |
anchor build
# Run tests
- name: Run tests
run: |
anchor test
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

.anchor
.DS_Store
solana-anchor-rustrover-template/target
**/*.rs.bk
node_modules
test-ledger
.yarn
17 changes: 17 additions & 0 deletions .idea/.editorconfig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/runConfigurations/AnchorBuild.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/runConfigurations/AnchorDeploy.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/runConfigurations/AnchorTest.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/runConfigurations/RunWithEnv.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/solana-anchor-rustrover-template.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

.anchor
.DS_Store
target
node_modules
dist
build
test-ledger
18 changes: 18 additions & 0 deletions Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[toolchain]

[features]
seeds = false
skip-lint = false

[programs.localnet]
{{project-name}} = "7YukY8tuR2GLzxS9cieRBjwbMidudYcj8R5aACLsbJCw"

[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 tests/**/*.ts"
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[workspace]
members = [
"programs/*"
]

[profile.release]
overflow-checks = true
lto = "fat"
codegen-units = 1

[profile.release.build-override]
opt-level = 3
incremental = false
codegen-units = 1
Loading

0 comments on commit 3ce7630

Please sign in to comment.