|
| 1 | +name: Update Actions Caches |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + |
| 12 | +env: |
| 13 | + CARGO_INCREMENTAL: 0 |
| 14 | + CARGO_TERM_COLOR: always |
| 15 | + CARGO_PROFILE_TEST_DEBUG: 0 |
| 16 | + CARGO_PROFILE_DEV_DEBUG: 0 |
| 17 | + CARGO_PROFILE_RELEASE_DEBUG: 0 |
| 18 | + CARGO_ARGS: --no-default-features --features stdlib,importlib,stdio,encodings,sqlite,ssl-rustls,host_env,threading,jit |
| 19 | + |
| 20 | +jobs: |
| 21 | + build-caches: |
| 22 | + name: Build Caches |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + include: |
| 27 | + - os: macos-latest |
| 28 | + toolchain: stable |
| 29 | + target: "" |
| 30 | + - os: ubuntu-latest |
| 31 | + toolchain: stable |
| 32 | + target: "" |
| 33 | + - os: windows-latest |
| 34 | + toolchain: stable |
| 35 | + target: "" |
| 36 | + steps: |
| 37 | + - name: Checkout RustPython main branch |
| 38 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 39 | + with: |
| 40 | + repository: RustPython/RustPython |
| 41 | + ref: main |
| 42 | + persist-credentials: false |
| 43 | + |
| 44 | + - name: Setup Rust |
| 45 | + uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 |
| 46 | + with: |
| 47 | + toolchain: ${{ matrix.toolchain }} |
| 48 | + target: ${{ matrix.target }} |
| 49 | + |
| 50 | + - name: Install macos dependencies |
| 51 | + uses: ./.github/actions/install-macos-deps |
| 52 | + with: |
| 53 | + openssl: true |
| 54 | + |
| 55 | + - name: Build dev cache # dev profile used by check & doc |
| 56 | + run: cargo build --profile dev ${{ env.CARGO_ARGS }} |
| 57 | + |
| 58 | + - name: Build test cache |
| 59 | + run: cargo build --profile test ${{ env.CARGO_ARGS }} |
| 60 | + |
| 61 | + - name: Build release cache |
| 62 | + run: cargo build --profile release ${{ env.CARGO_ARGS }} |
| 63 | + |
| 64 | + - name: Save cache |
| 65 | + uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 |
| 66 | + with: |
| 67 | + path: | |
| 68 | + ~/.cargo/bin/ |
| 69 | + ~/.cargo/registry/index/ |
| 70 | + ~/.cargo/registry/cache/ |
| 71 | + ~/.cargo/git/db/ |
| 72 | + target/ |
| 73 | + key: ${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('Cargo.lock') }}-${{ github.sha }} |
0 commit comments