Skip to content

Commit 0a2157e

Browse files
committed
Add GitHub actions, more tests
1 parent 7e9dafa commit 0a2157e

File tree

16 files changed

+1292
-55
lines changed

16 files changed

+1292
-55
lines changed

.github/dependabot.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for Rust dependencies
4+
- package-ecosystem: "cargo"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "06:00"
10+
open-pull-requests-limit: 10
11+
groups:
12+
# Group Solana-related updates together
13+
solana:
14+
patterns:
15+
- "solana-*"
16+
- "anchor-*"
17+
# Group test dependencies
18+
test-dependencies:
19+
dependency-type: "development"
20+
commit-message:
21+
prefix: "deps"
22+
include: "scope"
23+
labels:
24+
- "dependencies"
25+
- "rust"
26+
27+
# Enable version updates for GitHub Actions
28+
- package-ecosystem: "github-actions"
29+
directory: "/"
30+
schedule:
31+
interval: "weekly"
32+
day: "monday"
33+
time: "06:00"
34+
commit-message:
35+
prefix: "ci"
36+
include: "scope"
37+
labels:
38+
- "ci"
39+
- "github-actions"

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test Suite
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rust
20+
uses: dtolnay/rust-toolchain@stable
21+
with:
22+
components: rustfmt, clippy
23+
24+
- name: Cache dependencies
25+
uses: actions/cache@v3
26+
with:
27+
path: |
28+
~/.cargo/registry
29+
~/.cargo/git
30+
target
31+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-cargo-
34+
35+
- name: Build
36+
run: cargo build --verbose
37+
38+
- name: Run tests
39+
run: cargo test --verbose
40+
41+
- name: Check formatting
42+
run: cargo fmt -- --check
43+
44+
- name: Run clippy
45+
run: cargo clippy -- -D warnings
46+
47+
check:
48+
name: Check
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- name: Install Rust
54+
uses: dtolnay/rust-toolchain@stable
55+
56+
- name: Cache dependencies
57+
uses: actions/cache@v3
58+
with:
59+
path: |
60+
~/.cargo/registry
61+
~/.cargo/git
62+
target
63+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
64+
restore-keys: |
65+
${{ runner.os }}-cargo-
66+
67+
- name: Check
68+
run: cargo check --verbose
69+
70+
fmt:
71+
name: Rustfmt
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: Install Rust
77+
uses: dtolnay/rust-toolchain@stable
78+
with:
79+
components: rustfmt
80+
81+
- name: Check formatting
82+
run: cargo fmt --all -- --check
83+
84+
clippy:
85+
name: Clippy
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- name: Install Rust
91+
uses: dtolnay/rust-toolchain@stable
92+
with:
93+
components: clippy
94+
95+
- name: Cache dependencies
96+
uses: actions/cache@v3
97+
with:
98+
path: |
99+
~/.cargo/registry
100+
~/.cargo/git
101+
target
102+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
103+
restore-keys: |
104+
${{ runner.os }}-cargo-
105+
106+
- name: Run clippy
107+
run: cargo clippy --all-targets --all-features -- -D warnings

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "Version to publish (e.g., 0.1.0)"
11+
required: true
12+
type: string
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
17+
jobs:
18+
publish:
19+
name: Publish to crates.io
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
27+
- name: Cache dependencies
28+
uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.cargo/registry
32+
~/.cargo/git
33+
target
34+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-cargo-
37+
38+
- name: Install cargo-workspaces
39+
run: cargo install cargo-workspaces
40+
41+
- name: Check that workspace builds
42+
run: cargo build --release --verbose
43+
44+
- name: Run tests
45+
run: cargo test --release --verbose
46+
47+
- name: Login to crates.io
48+
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
49+
50+
- name: Dry run publish (check only)
51+
run: cargo workspaces publish --dry-run --yes --no-git-commit --no-git-tag --no-git-push
52+
53+
- name: Publish to crates.io
54+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
55+
run: cargo workspaces publish --yes --no-git-commit --no-git-tag --no-git-push
56+
57+
create-release:
58+
name: Create GitHub Release
59+
runs-on: ubuntu-latest
60+
needs: publish
61+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- name: Get version from tag
66+
id: get_version
67+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
68+
69+
- name: Create Release
70+
uses: actions/create-release@v1
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
tag_name: ${{ github.ref }}
75+
release_name: Release v${{ steps.get_version.outputs.VERSION }}
76+
body: |
77+
## Changes in v${{ steps.get_version.outputs.VERSION }}
78+
79+
### Crates Published
80+
- address-book v${{ steps.get_version.outputs.VERSION }}
81+
- anchor-utils v${{ steps.get_version.outputs.VERSION }}
82+
- testsvm v${{ steps.get_version.outputs.VERSION }}
83+
- testsvm-quarry v${{ steps.get_version.outputs.VERSION }}
84+
85+
### Installation
86+
```toml
87+
[dependencies]
88+
testsvm = "${{ steps.get_version.outputs.VERSION }}"
89+
```
90+
91+
See the [CHANGELOG](https://github.com/macalinao/testsvm/blob/main/CHANGELOG.md) for details.
92+
draft: false
93+
prerelease: false

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
TestSVM
33
</h1>
44

5-
<p align="center">
6-
Robust testing framework for Solana programs, written in Rust.
7-
</p>
8-
9-
TestSVM is a testing framework for Solana programs, written in Rust. Built on top of [LiteSVM](https://github.com/LiteSVM/litesvm), it is an order of magnitude faster than traditional `solana-test-validator` + JavaScript tests.
5+
TestSVM is a blazing fast testing framework for Solana programs, written in Rust. Built on top of [LiteSVM](https://github.com/LiteSVM/litesvm), tests written using TestSVM are an order of magnitude faster than traditional `solana-test-validator` + JavaScript tests.
106

117
Features include:
128

0 commit comments

Comments
 (0)