matrixes #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check the getting-started.sh script | |
on: | |
push: | |
branches: | |
- rzadp/getting-started | |
merge_group: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-getting-started: | |
strategy: | |
fail-fast: true | |
matrix: | |
container: [ubuntu, debian] | |
template: [minimal, solochain, parachain] | |
runs-on: ubuntu-latest | |
container: ${{ matrix.container }}:latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install prerequisites | |
run: apt update && apt install -y expect sudo | |
- name: Set additional expect flags if necessary | |
run: | | |
# Add a debug flag to expect, if github is re-run with debug logging enabled. | |
[ "${{ runner.debug }}" = "1" ] && EXPECT_FLAGS="-d" || EXPECT_FLAGS="" | |
echo "EXPECT_FLAGS=${EXPECT_FLAGS}" >> $GITHUB_ENV | |
- name: Check the first run if the script | |
run: | | |
# expect $EXPECT_FLAGS -c ' | |
expect -d -c ' | |
set timeout 120 | |
spawn bash scripts/getting-started.sh | |
expect_after { | |
timeout { puts stderr "Timed out on an expect"; exit 1 } | |
eof { puts stderr "EOF received on an expect"; exit 1 } | |
} | |
expect -nocase "Detected ${{ matrix.container }}" | |
# wait for dependencies installation | |
sleep 60 | |
expect "Rust is not installed. Install it?" { | |
send "y\r" | |
expect "Proceed with standard installation (default - just press enter)" { | |
send "\r" | |
sleep 60 | |
expect "Rust is installed now" | |
} | |
} | |
expect "Setup the Rust environment" { | |
send "y\r" | |
} | |
expect "start with one of the templates" { | |
send "y\r" | |
} | |
expect "1) ${{ matrix.template }} template" { | |
send "1\r" | |
} | |
expect "compile the node?" { | |
send "n\r" | |
} | |
expect eof | |
' | |
timeout-minutes: 15 | |
- name: Check the second run if the script | |
run: | | |
# expect $EXPECT_FLAGS -c ' | |
expect -d -c ' | |
set timeout 120 | |
spawn bash scripts/getting-started.sh | |
expect_after { | |
timeout { puts stderr "Timed out on an expect"; exit 1 } | |
eof { puts stderr "EOF received on an expect"; exit 1 } | |
} | |
expect "Rust already installed" {} | |
expect "Setup the Rust environment" { | |
send "n\r" | |
} | |
expect "start with one of the templates" { | |
send "y\r" | |
} | |
expect "1) ${{ matrix.template }} template" { | |
send "1\r" | |
expect "directory already exists" {} | |
} | |
expect "compile the node?" { | |
send "n\r" | |
} | |
expect eof | |
' | |
timeout-minutes: 15 | |
- name: Compile the node outside of the script | |
run: | | |
. "$HOME/.cargo/env" | |
cd ${{ matrix.template }}-template | |
cargo build --release | |
timeout-minutes: 120 | |
shell: bash | |
- name: Check that the binary is executable | |
run: | | |
. "$HOME/.cargo/env" | |
cd ${{ matrix.template }}-template | |
cargo run --release -- --help | |
shell: bash | |
timeout-minutes: 5 |