Skip to content
Unverified Commit 5e0ec3e0 authored by Przemek Rzad's avatar Przemek Rzad Committed by GitHub
Browse files

Update and test the `getting-started` script (#5446)



Here are some changes to the `getting-started.sh` scripts we have
advertised on top of the readme.

### Changes to the script

1. Change `echo` to a more portable `printf`.

On my machine, the script printed a literal `\n` string if run with
`bash`.
If I changed it to `echo -e`, then it printed a literal `-e` if run with
`sh`.

Changed it to `printf` which is more portable.

---

2. Template selection

The script proceeded to clone and build the `minimal` template, which is
not always what we want.
Added a selection prompt where the user can select one of the 3
templates, and choose if it should be built&run or not.
The user can also select no template at all - that way, we have a
starter of a dependencies-installation script.

---

3. Added some missing dependencies for some of the systems.

### A workflow testing the script

I propose a workflow, that will test the script using the
[expect](https://core.tcl-lang.org/expect/index) tool.
For each OS mentioned in the script (macOS, Ubuntu, Debian, Arch,
Fedora, OpenSUSE) we go through the script twice, and after that build
and run the template binary.

I'm using docker containers, so we start from scratch and make sure the
scripts installs all required dependencies - with the exception of
macOS, which I can't run from scratch in a container.

The jobs use a selected combination of OSes, shell interpreters (`bash`
or `sh`), and templates.
There is too much combinations to run them all, but I have [run it
once](https://github.com/paritytech-stg/polkadot-sdk/actions/runs/10509533645)
in staging to make sure all pass.

I'm adding a cron schedule because it can break without any code changes
in this repository (e.g. new `latest` release of a container).

---------

Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
parent cf330ccd
Pipeline #495653 waiting for manual action with stages
in 53 minutes and 6 seconds