|
| 1 | +name: Main |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + format_and_lint_programs: |
| 11 | + name: Format & Lint Programs |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Git Checkout |
| 15 | + uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Setup Environment |
| 18 | + uses: ./.github/actions/setup |
| 19 | + with: |
| 20 | + clippy: true |
| 21 | + rustfmt: true |
| 22 | + |
| 23 | + - name: Format Programs |
| 24 | + run: pnpm programs:format |
| 25 | + |
| 26 | + - name: Lint Programs |
| 27 | + run: pnpm programs:lint |
| 28 | + |
| 29 | + audit_rust: |
| 30 | + name: Audit Rust |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - name: Git Checkout |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Setup Environment |
| 37 | + uses: ./.github/actions/setup |
| 38 | + with: |
| 39 | + cargo-cache-key: cargo-audit |
| 40 | + |
| 41 | + - name: Install cargo-audit |
| 42 | + uses: taiki-e/install-action@v2 |
| 43 | + with: |
| 44 | + tool: cargo-audit |
| 45 | + |
| 46 | + - name: Run cargo-audit |
| 47 | + run: pnpm rust:audit |
| 48 | + |
| 49 | + semver_rust: |
| 50 | + name: Check semver Rust |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - name: Git Checkout |
| 54 | + uses: actions/checkout@v4 |
| 55 | + |
| 56 | + - name: Setup Environment |
| 57 | + uses: ./.github/actions/setup |
| 58 | + with: |
| 59 | + cargo-cache-key: cargo-semver |
| 60 | + |
| 61 | + - name: Install cargo-audit |
| 62 | + uses: taiki-e/install-action@v2 |
| 63 | + with: |
| 64 | + tool: cargo-semver-checks |
| 65 | + |
| 66 | + - name: Run semver checks |
| 67 | + run: pnpm rust:semver |
| 68 | + |
| 69 | + spellcheck_rust: |
| 70 | + name: Spellcheck Rust |
| 71 | + runs-on: ubuntu-latest |
| 72 | + steps: |
| 73 | + - name: Git Checkout |
| 74 | + uses: actions/checkout@v4 |
| 75 | + |
| 76 | + - name: Setup Environment |
| 77 | + uses: ./.github/actions/setup |
| 78 | + with: |
| 79 | + cargo-cache-key: cargo-spellcheck |
| 80 | + |
| 81 | + - name: Install cargo-spellcheck |
| 82 | + uses: taiki-e/install-action@v2 |
| 83 | + with: |
| 84 | + tool: cargo-spellcheck |
| 85 | + |
| 86 | + - name: Run cargo-spellcheck |
| 87 | + run: pnpm rust:spellcheck |
| 88 | + |
| 89 | + build_programs: |
| 90 | + name: Build programs |
| 91 | + runs-on: ubuntu-latest |
| 92 | + needs: format_and_lint_programs |
| 93 | + steps: |
| 94 | + - name: Git Checkout |
| 95 | + uses: actions/checkout@v4 |
| 96 | + |
| 97 | + - name: Setup Environment |
| 98 | + uses: ./.github/actions/setup |
| 99 | + with: |
| 100 | + cargo-cache-key: cargo-programs |
| 101 | + solana: true |
| 102 | + |
| 103 | + - name: Build Programs |
| 104 | + run: pnpm programs:build |
| 105 | + |
| 106 | + - name: Upload Program Builds |
| 107 | + uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: program-builds |
| 110 | + path: ./target/deploy/*.so |
| 111 | + if-no-files-found: error |
| 112 | + |
| 113 | + - name: Save Program Builds For Client Jobs |
| 114 | + uses: actions/cache/save@v4 |
| 115 | + with: |
| 116 | + path: ./**/*.so |
| 117 | + key: ${{ runner.os }}-builds-${{ github.sha }} |
| 118 | + |
| 119 | + test_programs: |
| 120 | + name: Test Programs |
| 121 | + runs-on: ubuntu-latest |
| 122 | + needs: format_and_lint_programs |
| 123 | + steps: |
| 124 | + - name: Git Checkout |
| 125 | + uses: actions/checkout@v4 |
| 126 | + |
| 127 | + - name: Setup Environment |
| 128 | + uses: ./.github/actions/setup |
| 129 | + with: |
| 130 | + cargo-cache-key: cargo-program-tests |
| 131 | + cargo-cache-fallback-key: cargo-programs |
| 132 | + solana: true |
| 133 | + |
| 134 | + - name: Test Programs |
| 135 | + run: pnpm programs:test |
0 commit comments