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

Adding anchor project structure + config base ix #1

Merged
merged 4 commits into from
Nov 8, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
large-error-threshold = 1000
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
packages/**/generated/*
target/types/*
15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./node_modules/gts/",
"rules": {
"semi": ["error", "never"],
"node/no-extraneous-import": ["error", {
"allowModules": ["@marinade.finance/jest-utils"]
}]
},
"settings": {
"node": {
// Modules are used by jest dev
"allowModules": ["@jest/globals"]
}
}
}
46 changes: 46 additions & 0 deletions .github/workflows/anchor-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Anchor Test

on: workflow_dispatch

jobs:
anchor-test:
runs-on: ubuntu-latest
timeout-minutes: 20
# from https://github.com/ochaloup/projectserum-build-docker
container: docker.io/ochaloup/projectserum-build:v0.29.0_sol1.16.17_avm
steps:
- name: /root/.cargo to PATH
run: |
echo '/root/.cargo/bin/' >> $GITHUB_PATH
echo '/root/.avm/bin' >> $GITHUB_PATH
ln -s /root/.avm $HOME/
mkdir -p $HOME/.config
ln -s /root/.config/solana $HOME/.config/
- name: Info on AVM
run: |
avm list
avm use 0.29.0
- name: Checkout project
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Set nightly toolchain
run: rustup default nightly
- name: List rustup toolchains
run: rustup toolchain list
- name: Check solana config
run: solana config get

- name: Running tests for project
run: |
pnpm install
pnpm test

30 changes: 30 additions & 0 deletions .github/workflows/typescript-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout project
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- uses: dtolnay/rust-toolchain@stable

- run: pnpm install
- run: pnpm lint
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ target/
Cargo.lock

# These are backup files generated by rustfmt
.DS_Store
target
**/*.rs.bk

# JS
node_modules/
build/

# Anchor
.anchor
test-ledger
docker-target/

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# IDE
.coderrect/
.idea/
.vscode/
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.anchor
.DS_Store
target
node_modules
dist
build
test-ledger

packages/**/generated/*
target/types/*
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
...require('gts/.prettierrc.json'),
bracketSpacing: true,
semi: false
}
26 changes: 26 additions & 0 deletions Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[toolchain]
anchor_version = "0.29.0"
solana_version = "1.16.17"

[workspace]
types = "packages/validator-bonds-sdk/generated/"

[features]
seeds = true
skip-lint = false

[programs.mainnet]
validator_bonds = "vbondsKbsC4QSLQQnn6ngZvkqfywn6KgEeQbkGSpk1V"

[programs.devnet]
validator_bonds = "vbondsKbsC4QSLQQnn6ngZvkqfywn6KgEeQbkGSpk1V"

[programs.localnet]
validator_bonds = "vbondsKbsC4QSLQQnn6ngZvkqfywn6KgEeQbkGSpk1V"

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

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