main.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. name: Main
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. env:
  8. SBPF_PROGRAM_PACKAGES: "['program']"
  9. RUST_PACKAGES: "['clients-cli', 'interface', 'program']"
  10. WASM_PACKAGES: "['interface', 'program']"
  11. jobs:
  12. set_env:
  13. name: Set variables to be used in strategy definitions in reusable workflow
  14. runs-on: ubuntu-latest
  15. outputs:
  16. SBPF_PROGRAM_PACKAGES: ${{ steps.compute.outputs.SBPF_PROGRAM_PACKAGES }}
  17. RUST_PACKAGES: ${{ steps.compute.outputs.RUST_PACKAGES }}
  18. WASM_PACKAGES: ${{ steps.compute.outputs.WASM_PACKAGES }}
  19. RUST_TOOLCHAIN_NIGHTLY: ${{ steps.compute.outputs.RUST_TOOLCHAIN_NIGHTLY }}
  20. SOLANA_CLI_VERSION: ${{ steps.compute.outputs.SOLANA_CLI_VERSION }}
  21. steps:
  22. - name: Git Checkout
  23. uses: actions/checkout@v4
  24. - name: Compute variables
  25. id: compute
  26. shell: bash
  27. run: |
  28. echo "SBPF_PROGRAM_PACKAGES=${{ env.SBPF_PROGRAM_PACKAGES }}" >> $GITHUB_OUTPUT
  29. echo "RUST_PACKAGES=${{ env.RUST_PACKAGES }}" >> $GITHUB_OUTPUT
  30. echo "WASM_PACKAGES=${{ env.WASM_PACKAGES }}" >> $GITHUB_OUTPUT
  31. echo "RUST_TOOLCHAIN_NIGHTLY=$(make rust-toolchain-nightly)" >> "$GITHUB_OUTPUT"
  32. echo "SOLANA_CLI_VERSION=$(make solana-cli-version)" >> "$GITHUB_OUTPUT"
  33. main:
  34. needs: set_env
  35. uses: solana-program/actions/.github/workflows/main.yml@main
  36. with:
  37. sbpf-program-packages: ${{ needs.set_env.outputs.SBPF_PROGRAM_PACKAGES }}
  38. rust-packages: ${{ needs.set_env.outputs.RUST_PACKAGES }}
  39. wasm-packages: ${{ needs.set_env.outputs.WASM_PACKAGES }}
  40. rustfmt-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }}
  41. clippy-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }}
  42. solana-cli-version: ${{ needs.set_env.outputs.SOLANA_CLI_VERSION }}