Skip to content

Commit

Permalink
Merge pull request #4 from gluwa/testing/CSUB-493-testing-in-github
Browse files Browse the repository at this point in the history
CSUB-493: Testing in GitHub
  • Loading branch information
AdaJane authored Jul 25, 2023
2 parents ee4ee95 + 1d7c739 commit 4e22d40
Show file tree
Hide file tree
Showing 19 changed files with 1,154 additions and 278 deletions.
7 changes: 7 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ rustflags = [
"-Aclippy::derivable_impls", # false positives
"-Aclippy::stable_sort_primitive", # prefer stable sort
]


[env]
# Required for rust toolchains 1.70.0+ until this commit
# https://github.com/paritytech/substrate/commit/dd45632f298db02f6946c906296bbf86a74f4f46
# is included in a release and we update to depend on it for the substrate-wasm-builder
WASM_BUILD_RUSTFLAGS = "-C target-cpu=mvp -C target-feature=-sign-ext"
2 changes: 2 additions & 0 deletions .github/authorized_keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDx+qASehgC8DfKf/QdI9vDItG7BHAjjFXsIiWbJ/F4QG/DK5py6VVI18/r+pgdN0pJMyXUviSmWwn+4XJUNaRHliVUcs9I+NsSjjopvJi+G3OfJr/JAcUFOp4OutpbkEpYVujEA9U/b3HHMJsJ7pBS0sLhx9wx9vKDD9M6Fzj31VoD1Z5NS9uVH16sftJQ/JofO3zS379IK12CDlmcyYPG79KNoQwUHY8+BMOcmUNCCipHQ3QDAyr1kzKCKiHNpcAuKiJUlEvkQtW62Wvgv8/Muq2we+o/E6Fs1QV8fg42MWbtXXc8eqPLVG+/TRrxScn+AHTt7NXsOqDI62s3wgHb ubuntu@crb307-n2
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDOYiBGthrSNqUJdN9h9PHzXQL8cP8gj5pP9LZDx7BVgt/Knm9NwAe9hD/7fs9zmyECmZ5ubHDqG0x7Hb7DAjl+oPkCOxqRj5Npfvl1VRwwgXl3ymfI3JJpF7Cna4n0XdylBsTiwOL1/zoVXEJgTYEDEsP4gv65i8M/uWlsrfFwHLDEr3EQKnA0H4Ekz1CU2n9MFprX1hzA5IItozQUsYxKTPr1mxNTi1AFMhDEztMelvPO1OuC8MBZURR9S/+SlZ8ydCUcwl0gdCcgpUfouiuN9Yr9UbiV/yrAxEY3oKX8OegFmWEioUIZoFSiXl3sNP39ntOR4i+GV54g4omN6JbN3ios9LXBPMuvCy1NgFYPmDmmSEuo7n2IsP3pcXjZXpl4Ymwvn4RJviOZq8vghF5p0YMtCis1LxHL90epibxGoV6nc5isrOzqfgNUA9IS1zx7ZMoaF1PT8QcT8NzgNocrrhH4xGeTLD7WOOxykVASBnIXea8p7dl29/G0ThmS7Bc= [email protected]
26 changes: 26 additions & 0 deletions .github/provision-github-runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

mkdir actions-runner
pushd actions-runner || exit 1

curl -L https://github.com/actions/runner/releases/download/v2.302.1/actions-runner-linux-x64-2.302.1.tar.gz > runner.tar.gz

tar xzf ./runner.tar.gz
sudo ./bin/installdependencies.sh
sudo apt install -y jq

OWNER_REPO_SLUG="gluwa/substrate"
REPOSITORY_URL="https://github.com/$OWNER_REPO_SLUG"
EPHEMERAL=${LC_RUNNER_EPHEMERAL:-true}

# we need a temporary registration token first
REGISTRATION_TOKEN=$(curl --silent -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $LC_GITHUB_REPO_ADMIN_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$OWNER_REPO_SLUG/actions/runners/registration-token" | jq -r '.token')

# Important: ephemeral runners are removed after a single job is executed on them
# which is inline with the VM lifecycle
./config.sh --unattended --ephemeral "$EPHEMERAL" --url "$REPOSITORY_URL" --token "$REGISTRATION_TOKEN" --labels "$LC_RUNNER_VM_NAME"
nohup ./run.sh >/dev/null 2>&1 </dev/null &
Loading

0 comments on commit 4e22d40

Please sign in to comment.