# Adding WASI to CI

**URL:** <https://discuss.python.org/t/adding-wasi-to-ci/46481>\
**Category:** Core Development\
**Created:** [February 21, 2024, 12:33am UTC](https://discuss.python.org/t/adding-wasi-to-ci/46481 "2024-02-21T00:33:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettcannon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/brettcannon/32/34895_2.png) [@brettcannon](https://discuss.python.org/u/brettcannon)\
**Post date:** [February 21, 2024, 12:33am UTC](https://discuss.python.org/t/adding-wasi-to-ci/46481/1 "2024-02-21T00:33:09Z")

</div>

Now that WASI is a tier 2 platform, I would like to add it to CI as a non-required check. I [quickly put together a GitHub Action workflow](https://github.com/brettcannon/cpython-wasi-build/blob/main/.github/workflows/test.yml) to measure the time it would take to build and run the test suite and it [appears to be about 10 minutes](https://github.com/brettcannon/cpython-wasi-build/actions/runs/7981689664/job/21793860069) (thanks to not having various tests related to subprocesses being disabled due to lack of support in WASI). Compare that to our other tests and it would definitely not be the slowest CI check we run. Arbitrarily grabbing [gh-67044: Always quote or escape \r and \n in csv.writer() by serhiy-storchaka · Pull Request #115741 · python/cpython · GitHub](https://github.com/python/cpython/pull/115741) as an example (from lowest to WASI):

1. 21 minutes: CIFuzz (memory)
2. 20 minutes: CIFuzz (undefined)
3. 19 minutes: CIFuzz (address)
4. 17 minutes: Windows (free-threading) / build and test (x86)
5. 16 minutes: Windows (free-threading) / build and test (x64)
6. 14 minutes: Windows / build and test (x86)
7. 13 minutes: macOS (free-threading) / build and test (macos-13)
8. 11 minutes: macOS / build and test (macos-13)
9. 10 minutes: **WASI**

Another benefit to having WASI in CI is it is a cross-build, so it will lessen our chances of breaking in that as well.

The SC said they were good with adding a WASI check if if didn’t make overall CI slower which this timing suggests it won’t.

Anyone have issues if I add WASI to CI? I would only do it for `main`/3.13 since that’s when tier 2 was established.

---

<div class="post-metadata">

**Author:** ![brettcannon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/brettcannon/32/34895_2.png) [@brettcannon](https://discuss.python.org/u/brettcannon)\
**Post date:** [March 8, 2024, 9:17pm UTC](https://discuss.python.org/t/adding-wasi-to-ci/46481/2 "2024-03-08T21:17:30Z")

</div>

I opened [GH-115976: Add WASI to CI by brettcannon · Pull Request #116516 · python/cpython · GitHub](https://github.com/python/cpython/pull/116516) for the CI job and it completed in 9 minutes w/ only a partial cache (I changed the key for the `config.cache` entry for the WASI host build).

I’m going to check on Discord if anyone wants to review the PR, otherwise I will merge it.

---

<div class="post-metadata">

**Author:** ![brettcannon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/brettcannon/32/34895_2.png) [@brettcannon](https://discuss.python.org/u/brettcannon)\
**Post date:** [March 11, 2024, 7:04pm UTC](https://discuss.python.org/t/adding-wasi-to-ci/46481/3 "2024-03-11T19:04:31Z")

</div>

And now the PR is merged!
