-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
15,266 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
large-error-threshold = 1_000_000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Setup Solana" | ||
description: "Setup Solana" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/cache@v2 | ||
name: Cache Solana Tool Suite | ||
id: cache-solana | ||
with: | ||
path: | | ||
~/.cache/solana/ | ||
~/.local/share/solana/ | ||
key: solana-${{ runner.os }}-v0000-${{ env.SOLANA_CLI_VERSION }} | ||
- run: sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_CLI_VERSION }}/install)" | ||
shell: bash | ||
- run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | ||
shell: bash | ||
- run: solana-keygen new --no-bip39-passphrase | ||
shell: bash | ||
- run: solana config set --url localhost | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: "Setup" | ||
description: "Setup" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: sudo apt-get update && sudo apt-get install -y pkg-config build-essential libudev-dev | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
env: | ||
SOLANA_CLI_VERSION: 1.16.17 | ||
jobs: | ||
build-and-test: | ||
name: Build and test programs | ||
runs-on: big-runner-1 | ||
|
||
steps: | ||
# Setup | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- uses: ./.github/actions/setup/ | ||
- uses: ./.github/actions/setup-solana/ | ||
- uses: actions/cache@v2 | ||
name: Cache Cargo registry + index | ||
id: cache-anchor | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }} | ||
- run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.28.0 anchor-cli --locked --force | ||
working-directory: / | ||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly-2023-10-05-x86_64-unknown-linux-gnu | ||
components: rustfmt, clippy | ||
|
||
# --force is hack around cargo caching, figure out later | ||
- name: Setup Rust tools | ||
run: | | ||
cargo +nightly-2023-10-05 install cargo-sort --force | ||
cargo +nightly-2023-10-05 install cargo-udeps --force | ||
shell: bash | ||
|
||
- name: cargo sort | ||
run: cargo +nightly-2023-10-05 sort --workspace --check | ||
shell: bash | ||
|
||
- name: cargo fmt | ||
run: cargo +nightly-2023-10-05 fmt --all --check | ||
shell: bash | ||
|
||
- name: clippy | ||
run: cargo +nightly-2023-10-05 clippy --all-features --all-targets --tests -- -D warnings | ||
shell: bash | ||
|
||
- name: cargo udeps | ||
run: cargo +nightly-2023-10-05 udeps --all-features --all-targets --tests | ||
shell: bash | ||
|
||
# Build IDLs | ||
- name: Build validator-history | ||
run: anchor build --idl idl --program-name validator_history | ||
|
||
# Make sure no uncommitted changes | ||
- name: Check for diff | ||
run: git diff --exit-code | ||
|
||
- name: cargo test | ||
run: RUST_LOG=debug cargo test --all-targets --all-features --color auto | ||
shell: bash | ||
|
||
verified-build: | ||
name: Build Verifiable Artifact | ||
runs-on: big-runner-1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
# --force because the cargo cache has it saved | ||
- name: Install Solana Verify | ||
run: | | ||
cargo install solana-verify --force | ||
solana-verify --version | ||
- name: Verifiable Build | ||
run: | | ||
solana-verify build --library-name validator_history | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build | ||
path: | | ||
target/deploy/validator_history.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
SOLANA_CLI_VERSION: 1.16.17 | ||
jobs: | ||
release: | ||
name: Create the jito programs release | ||
runs-on: big-runner-1 | ||
|
||
steps: | ||
# Setup | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- uses: ./.github/actions/setup/ | ||
- uses: ./.github/actions/setup-solana/ | ||
- uses: actions/cache@v2 | ||
name: Cache Cargo registry + index | ||
id: cache-anchor | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }} | ||
- run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.28.0 anchor-cli --locked --force | ||
|
||
# Build IDLs + programs | ||
- name: Build program | ||
run: anchor build --idl idl --program-name validator_history | ||
|
||
# Verified build | ||
# --force because the cargo cache has it saved | ||
- name: Install Solana Verify | ||
run: | | ||
cargo install solana-verify --force | ||
solana-verify --version | ||
- name: Verifiable Build | ||
run: | | ||
solana-verify build --library-name validator_history | ||
# Make sure no uncommitted changes | ||
- name: Check for diff | ||
run: git diff --exit-code | ||
|
||
# Upload artifacts | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build | ||
path: | | ||
target/deploy/validator_history.so | ||
programs/validator-history/idl/validator_history.json | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
target/deploy/validator_history.so | ||
programs/validator-history/idl/validator_history.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.anchor | ||
.DS_Store | ||
**/target | ||
*/debug | ||
*/node_modules | ||
*/deps | ||
*/dist | ||
*/build | ||
test-ledger | ||
*/test-ledger | ||
.idea/ | ||
**/targets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[features] | ||
seeds = false | ||
skip-lint = false | ||
[programs.localnet] | ||
validator_history = "HistoryJTGbKQD2mRgLZ3XhqHnN811Qpez8X9kCcGHoa" | ||
|
||
[workspace] | ||
members = [ | ||
"programs/validator-history", | ||
] | ||
exclude = ["keepers", "utils"] | ||
|
||
[registry] | ||
url = "https://api.apr.dev" | ||
|
||
[provider] | ||
cluster = "Localnet" | ||
wallet = "~/.config/solana/id.json" | ||
|
||
[scripts] | ||
test = "cargo +nightly test" |
Oops, something went wrong.