chore: update ErrorCode and add require macro #664
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| run_cargo_checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Rust install nightly | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy, rustfmt | |
| - name: Run Cargo fmt | |
| run: cargo +nightly fmt --all -- --check | |
| - name: Run Cargo clippy | |
| run: cargo clippy --all-targets --all-features | |
| run_benchmarks: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| benches/program-bench/ -> target | |
| - name: Rust install | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Solana CLI | |
| run: | | |
| sh -c "$(curl -sSfL https://release.anza.xyz/v3.0.4/install)" | |
| echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
| - name: Run benchmarks | |
| run: | | |
| chmod +x scripts/run-benchmarks.sh | |
| ./scripts/run-benchmarks.sh | |
| - name: Commit updated benchmark results | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| # Check if there are changes to BENCHMARK.md | |
| if git diff --quiet benches/BENCHMARK.md; then | |
| echo "No changes to benchmark results" | |
| else | |
| echo "Benchmark results have changed, committing updates" | |
| git add benches/BENCHMARK.md | |
| git commit -m "chore: update benchmark results [skip ci]" | |
| git push origin main | |
| fi | |
| - name: Upload benchmark results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results | |
| path: benches/BENCHMARK.md | |
| retention-days: 30 | |
| run_examples_tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [ | |
| "anchor-cpi", | |
| "counter", | |
| "cpi", | |
| "hello-world", | |
| "instruction-data", | |
| "misc", | |
| "seeded", | |
| "seeds", | |
| "transfer-sol", | |
| "transfer-token" | |
| ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Rust install | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Setup cache | |
| uses: Swatinem/rust-cache@v2 | |
| - uses: taiki-e/install-action@just | |
| - name: Install Solana CLI | |
| run: | | |
| sh -c "$(curl -sSfL https://release.anza.xyz/v3.0.4/install)" | |
| echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
| - name: Build program | |
| run: just build ${{ matrix.example }} | |
| - name: Test program | |
| run: just test ${{ matrix.example }} | |
| run_basic_tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Rust install | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Run tests | |
| run: cargo test |