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

CI: Add program and all extra steps #13

Merged
merged 2 commits into from
Dec 18, 2024
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
134 changes: 133 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,85 @@ jobs:
- name: Lint Client Rust
run: pnpm clients:rust:lint

format_and_lint_program:
name: Format & Lint Program
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
clippy: true
rustfmt: true

- name: Format
run: pnpm programs:format

- name: Lint
run: pnpm programs:lint

audit_rust:
name: Audit Rust
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
cargo-cache-key: cargo-audit

- name: Install cargo-audit
uses: taiki-e/install-action@v2
with:
tool: cargo-audit

- name: Run cargo-audit
run: pnpm rust:audit

semver_rust:
name: Check semver Rust
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
cargo-cache-key: cargo-semver

- name: Install cargo-audit
uses: taiki-e/install-action@v2
with:
tool: cargo-semver-checks

- name: Run semver checks
run: pnpm rust:semver

spellcheck_rust:
name: Spellcheck Rust
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
cargo-cache-key: cargo-spellcheck

- name: Install cargo-spellcheck
uses: taiki-e/install-action@v2
with:
tool: cargo-spellcheck

- name: Run cargo-spellcheck
run: pnpm rust:spellcheck

generate_clients:
name: Check Client Generation
runs-on: ubuntu-latest
Expand All @@ -63,10 +142,40 @@ jobs:
git status --porcelain
test -z "$(git status --porcelain)"

build_program:
name: Build Program
runs-on: ubuntu-latest
needs: format_and_lint_program
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
cargo-cache-key: cargo-build-program
solana: true

- name: Build
run: pnpm programs:build

- name: Upload Program Builds
uses: actions/upload-artifact@v4
with:
name: program-builds
path: ./target/deploy/*.so
if-no-files-found: error

- name: Save Program Builds For Client Jobs
uses: actions/cache/save@v4
with:
path: ./**/*.so
key: ${{ runner.os }}-builds-${{ github.sha }}

test_client_js:
name: Test Client JS
runs-on: ubuntu-latest
needs: format_and_lint_client_js
needs: [format_and_lint_client_js, build_program]
steps:
- name: Git Checkout
uses: actions/checkout@v4
Expand All @@ -76,6 +185,12 @@ jobs:
with:
solana: true

- name: Restore Program Builds
uses: actions/cache/restore@v4
with:
path: ./**/*.so
key: ${{ runner.os }}-builds-${{ github.sha }}

- name: Test Client JS
run: pnpm clients:js:test

Expand All @@ -96,3 +211,20 @@ jobs:

- name: Test Client Rust
run: pnpm clients:rust:test

test_program:
name: Test Program
runs-on: ubuntu-latest
needs: format_and_lint_program
steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: Setup Environment
uses: ./.github/actions/setup
with:
cargo-cache-key: cargo-test-program
solana: true

- name: Test
run: pnpm programs:test
Loading
Loading