-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add README CI
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
echo ==== Quick Deploy ==== | ||
TEXT=$(printf 'y\n' | near dev-deploy --wasmFile res/status_message.wasm --helperUrl https://near-contract-helper.onrender.com) | ||
if [[ ! "$TEXT" =~ .*"Done deploying to".* ]]; then | ||
echo -e "\033[0;31m FAIL \033[0m" | ||
exit 1 | ||
else | ||
echo -e "\033[0;32m SUCCESS \033[0m" | ||
fi | ||
|
||
echo ==== Set dev account env variable ==== | ||
source neardev/dev-account.env | ||
TEXT=$(echo $CONTRACT_NAME) | ||
if [[ ! "$TEXT" =~ .*"dev-".* ]]; then | ||
echo -e "\033[0;31m FAIL \033[0m" | ||
exit 1 | ||
else | ||
echo -e "\033[0;32m SUCCESS \033[0m" | ||
fi | ||
|
||
echo ==== Set status ==== | ||
TEXT=$(near call $CONTRACT_NAME set_status '{"message": "aloha!"}' --accountId $CONTRACT_NAME) | ||
if [[ ! "$TEXT" =~ .*"To see the transaction in the transaction explorer".* ]]; then | ||
echo -e "\033[0;31m FAIL \033[0m" | ||
exit 1 | ||
else | ||
echo -e "\033[0;32m SUCCESS \033[0m" | ||
fi | ||
|
||
echo ==== Get status ==== | ||
TEXT=$(near view $CONTRACT_NAME get_status '{"account_id": "'$CONTRACT_NAME'"}') | ||
if [[ ! "$TEXT" =~ .*"aloha!".* ]]; then | ||
echo -e "\033[0;31m FAIL \033[0m" | ||
exit 1 | ||
else | ||
echo -e "\033[0;32m SUCCESS \033[0m" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Readme CI | ||
on: | ||
repository_dispatch: | ||
types: [tests-report] | ||
push: | ||
jobs: | ||
readme-ci: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] # mac-os lags out | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v2 | ||
- name: Install Node | ||
uses: actions/setup-node@v2 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
- name: Install NEAR CLI | ||
run: npm install near-cli -g | ||
- name: Building this contract | ||
run: npm run build | ||
- name: Run Readme Quick Deploy Commands | ||
run: bash .github/scripts/readme.sh |