|
14 | 14 | WASI_SDK_RELEASE: wasi-sockets-alpha-5 |
15 | 15 |
|
16 | 16 | jobs: |
| 17 | + linux: |
| 18 | + name: Populate cache |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + submodules: "recursive" |
| 25 | + |
| 26 | + - uses: actions/setup-python@v5 |
| 27 | + with: |
| 28 | + python-version: "3.12" |
| 29 | + |
| 30 | + - name: Install latest Rust nightly toolchain |
| 31 | + uses: dtolnay/rust-toolchain@nightly |
| 32 | + with: |
| 33 | + targets: wasm32-wasip1 wasm32-unknown-unknown |
| 34 | + |
| 35 | + - name: Install latest Rust stable toolchain |
| 36 | + uses: dtolnay/rust-toolchain@stable |
| 37 | + with: |
| 38 | + targets: wasm32-wasip1 wasm32-unknown-unknown |
| 39 | + components: clippy, rustfmt |
| 40 | + |
| 41 | + - name: Install Rust std source |
| 42 | + shell: bash |
| 43 | + run: rustup component add rust-src --toolchain nightly |
| 44 | + |
| 45 | + - uses: Swatinem/rust-cache@v2 |
| 46 | + with: |
| 47 | + shared-key: "rust-cache-${{ hashFiles('./Cargo.lock') }}" |
| 48 | + cache-on-failure: false |
| 49 | + |
| 50 | + - name: Install WASI-SDK |
| 51 | + shell: bash |
| 52 | + run: | |
| 53 | + cd /tmp |
| 54 | + curl -LO https://github.com/dicej/wasi-sdk/releases/download/${WASI_SDK_RELEASE}/wasi-sdk-${WASI_SDK_VERSION}-linux.tar.gz |
| 55 | + tar xf wasi-sdk-${WASI_SDK_VERSION}-linux.tar.gz |
| 56 | + mv wasi-sdk-${WASI_SDK_VERSION} /opt/wasi-sdk |
| 57 | +
|
| 58 | + - name: Cache CPython |
| 59 | + id: cache-cpython-wasi |
| 60 | + uses: actions/cache@v4 |
| 61 | + with: |
| 62 | + path: cpython/builddir/wasi |
| 63 | + key: cpython-wasi |
| 64 | + enableCrossOsArchive: true |
| 65 | + |
| 66 | + - name: Build |
| 67 | + shell: bash |
| 68 | + run: cargo build --release |
| 69 | + |
17 | 70 | test: |
18 | 71 | name: Test |
19 | 72 | strategy: |
|
67 | 120 | shell: bash |
68 | 121 | run: echo "WASI_SDK_PATH=$(cygpath -m /tmp/wasi-sdk-${WASI_SDK_VERSION})" >> ${GITHUB_ENV} |
69 | 122 |
|
70 | | - - name: Cache CPython |
| 123 | + - name: Restore CPython |
71 | 124 | id: cache-cpython-wasi |
72 | | - uses: actions/cache@v4 |
| 125 | + uses: actions/cache/restore@v4 |
73 | 126 | with: |
74 | 127 | path: cpython/builddir/wasi |
75 | 128 | key: cpython-wasi |
|
0 commit comments