|
1 | 1 | name: "Setup Prebuild" |
2 | | -description: "Minimal setup for runners with pre-built Rust toolchain, nextest, and sccache" |
| 2 | +description: "Fast CI setup — uses pre-installed tools on prebuild AMIs, falls back to full setup-rust otherwise" |
| 3 | + |
| 4 | +inputs: |
| 5 | + repo-token: |
| 6 | + description: "GitHub token for accessing the repository (typically secrets.GITHUB_TOKEN)" |
| 7 | + required: false |
| 8 | + default: "${{ github.token }}" |
| 9 | + toolchain: |
| 10 | + description: "optional override for the toolchain version (e.g. nightly)" |
| 11 | + required: false |
| 12 | + components: |
| 13 | + description: "optional override for the components to install for the step (e.g. clippy, rustfmt, miri)" |
| 14 | + default: "clippy, rustfmt" |
| 15 | + required: false |
| 16 | + targets: |
| 17 | + description: "optional targets override (e.g. wasm32-unknown-unknown)" |
| 18 | + required: false |
| 19 | + enable-sccache: |
| 20 | + description: "Should sccache be enabled, true by default." |
| 21 | + required: false |
| 22 | + default: "true" |
3 | 23 |
|
4 | 24 | runs: |
5 | 25 | using: "composite" |
6 | 26 | steps: |
| 27 | + # --- Prebuild path: tools already installed, just configure sccache --- |
7 | 28 | - name: Configure sccache timeout |
| 29 | + if: github.repository == 'vortex-data/vortex' && inputs.enable-sccache == 'true' |
8 | 30 | shell: bash |
9 | 31 | run: | |
10 | 32 | mkdir -p ~/.config/sccache |
11 | 33 | echo 'server_startup_timeout_ms = 15000' > ~/.config/sccache/config |
12 | 34 |
|
13 | 35 | - name: Pre-start sccache server |
| 36 | + if: github.repository == 'vortex-data/vortex' && inputs.enable-sccache == 'true' |
14 | 37 | shell: bash |
15 | 38 | run: sccache --start-server & |
| 39 | + |
| 40 | + # --- Fallback path: full setup for forks --- |
| 41 | + - name: Full Rust setup |
| 42 | + if: github.repository != 'vortex-data/vortex' |
| 43 | + uses: ./.github/actions/setup-rust |
| 44 | + with: |
| 45 | + repo-token: ${{ inputs.repo-token }} |
| 46 | + toolchain: ${{ inputs.toolchain }} |
| 47 | + components: ${{ inputs.components }} |
| 48 | + targets: ${{ inputs.targets }} |
| 49 | + enable-sccache: ${{ inputs.enable-sccache }} |
0 commit comments