|
| 1 | +name: Rust |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + types: [opened, synchronize, reopened] |
| 9 | + branches: |
| 10 | + - main |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +env: |
| 17 | + SOLANA_CLI_VERSION: "2.3.11" |
| 18 | + RUST_TOOLCHAIN: "1.90.0" |
| 19 | + |
| 20 | +jobs: |
| 21 | + test-rust: |
| 22 | + name: ${{ matrix.name || (matrix.package && format('{0}/{1}', matrix.example, matrix.package)) || matrix.example }} |
| 23 | + runs-on: ubuntu-latest |
| 24 | + strategy: |
| 25 | + fail-fast: false |
| 26 | + matrix: |
| 27 | + example: |
| 28 | + - create-and-update |
| 29 | + - counter/native |
| 30 | + - counter/pinocchio |
| 31 | + - account-comparison |
| 32 | + - airdrop-implementations/simple-claim/program |
| 33 | + include: |
| 34 | + - example: basic-operations/native |
| 35 | + package: native-program-burn |
| 36 | + - example: basic-operations/native |
| 37 | + package: native-program-create |
| 38 | + - example: basic-operations/native |
| 39 | + package: native-program-update |
| 40 | + - example: basic-operations/native |
| 41 | + package: native-program-close |
| 42 | + - example: basic-operations/native |
| 43 | + package: native-program-reinit |
| 44 | + - example: anchor |
| 45 | + package: escrow |
| 46 | + name: anchor escrow |
| 47 | + - example: anchor |
| 48 | + package: light-token-minter |
| 49 | + name: anchor light-token-minter |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + |
| 53 | + - name: Setup environment |
| 54 | + uses: ./.github/actions/setup |
| 55 | + with: |
| 56 | + example: ${{ matrix.example }} |
| 57 | + solana-cli-version: ${{ env.SOLANA_CLI_VERSION }} |
| 58 | + rust-toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 59 | + |
| 60 | + - name: Build and test |
| 61 | + working-directory: ${{ matrix.example }} |
| 62 | + run: | |
| 63 | + if [ -n "${{ matrix.package }}" ]; then |
| 64 | + cargo test-sbf -p ${{ matrix.package }} |
| 65 | + else |
| 66 | + cargo test-sbf |
| 67 | + fi |
0 commit comments