Skip to content
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
23 changes: 1 addition & 22 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,13 @@ on:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]
types: [opened, synchronize, reopened]
branches:
- main

# A workflow run is made up of one or more jobs, which run in parallel by default
# Each job runs in a runner environment specified by runs-on
jobs:
# Unique identifier of our job (`job_id`)
test:
# Sets the name `Test` for the job, which is displayed in the GitHub UI
name: Test
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
# The uses keyword specifies that this step will run v3 of the actions/checkout action.
# This is an action that checks out your repository onto the runner, allowing you to run scripts or other actions against your code (such as build and test tools).
# You should use the checkout action any time your workflow will run against the repository's code.
uses: actions/checkout@v4

# This GitHub Action installs a Rust toolchain using rustup. It is designed for one-line concise usage and good defaults.
- name: Install the Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Run tests
run: cargo test

# `fmt` container job
fmt:
name: Rustfmt
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/solana-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ jobs:
return 1
fi

# Run Rust unit tests
if [ -d "program" ]; then
echo "Running Rust unit tests for $project"
if ! cargo test --manifest-path=./program/Cargo.toml; then
echo "::error::Rust unit tests failed for $project"
echo "$project: Rust unit tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
cd - > /dev/null
return 1
fi
fi

# Test
if ! pnpm build-and-test; then
echo "::error::tests failed for $project"
Expand Down
Loading