Add minimum unit price adjustment for solflare #483
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: Run Examples | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
check_example_directories: | |
runs-on: ubuntu-latest | |
outputs: | |
dir: ${{ steps.set-dirs.outputs.dir }} | |
steps: | |
- uses: actions/checkout@v2 | |
- id: set-dirs | |
run: echo "::set-output name=dir::$(ls -d example/*/ | jq -R -s -c 'split("\n")[:-1]')" | |
run: | |
runs-on: ubuntu-latest | |
needs: [check_example_directories] | |
strategy: | |
fail-fast: false | |
matrix: | |
# List matrix strategy from directories dynamically | |
dir: ${{fromJson(needs.check_example_directories.outputs.dir)}} | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: Set up SCons | |
shell: bash | |
run: | | |
python -c "import sys; print(sys.version)" | |
python -m pip install scons==4.8 | |
scons --version | |
- uses: chickensoft-games/setup-godot@v1 | |
name: 🤖 Setup Godot | |
with: | |
version: 4.3.0 | |
use-dotnet: false | |
include-templates: true | |
- name: Checkout project | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Build binary | |
shell: bash | |
run: | | |
scons | |
- name: (Web) Install emsdk toolchain | |
if: ${{ endsWith(matrix.dir, 'Web/') }} | |
uses: mymindstorm/setup-emsdk@v14 | |
with: | |
version: 3.1.64 | |
- name: (Web) Build binary | |
if: ${{ endsWith(matrix.dir, 'Web/') }} | |
shell: bash | |
run: | | |
scons platform=web target=template_debug | |
- name: Prepare project | |
shell: bash | |
run: | | |
cp godot-solana-sdk.gdextension bin/ | |
cd ${{matrix.dir}} | |
ln -s ../../bin | |
mkdir .godot | |
echo "res://bin/godot-solana-sdk.gdextension" >> .godot/extension_list.cfg | |
- name: Setup Solana tools | |
uses: metadaoproject/[email protected] | |
- name: Load Test Accounts | |
id: test_accounts | |
run: | | |
cd ${{matrix.dir}} | |
if [ -d "test_accounts" ]; then | |
for file in "test_accounts"/*; do | |
if [ -f "$file" ]; then | |
str="${str} --account `echo -n "${file##*/}" | cut -f 1 -d '.' | tr -d $'\n'` ${{matrix.dir}}${file}" | |
fi | |
done | |
fi | |
mkdir -p test_accounts | |
solana program dump --url mainnet-beta CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR test_accounts/CMV3.so | |
str="${str} --bpf-program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR ${{matrix.dir}}test_accounts/CMV3.so" | |
solana program dump --url mainnet-beta metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s test_accounts/MPMD.so | |
str="${str} --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s ${{matrix.dir}}test_accounts/MPMD.so" | |
echo "VALIDATOR_ARGS=${str}" >> "$GITHUB_OUTPUT" | |
- name: Setup Local Validator | |
uses: switchboard-xyz/[email protected] | |
with: | |
solana-version: v1.18.22 | |
cluster: devnet | |
args: "${{steps.test_accounts.outputs.VALIDATOR_ARGS}}" | |
- name: (Web) Download Puppeteer | |
if: ${{ endsWith(matrix.dir, 'Web/') }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: (Web) Setup Puppeteer | |
if: ${{ endsWith(matrix.dir, 'Web/') }} | |
run: | | |
cd .github/workflows/puppeteer | |
npm init -y | |
npm install puppeteer | |
- name: (Web) Export project to web | |
if: ${{ endsWith(matrix.dir, 'Web/') }} | |
run: | | |
cd ${{matrix.dir}} | |
mkdir tmp | |
godot --headless --path . --export-debug Web tmp/tmp_js_export.html | |
- name: (Web) Download wallet mock | |
if: ${{ endsWith(matrix.dir, 'Web/') }} | |
uses: actions/checkout@v4 | |
with: | |
repository: 'Virus-Axel/solana-wallet-mock' | |
path: 'solana-wallet-mock' | |
- name: (Web) Test project in browser | |
if: ${{ endsWith(matrix.dir, 'Web/') }} | |
run: | | |
python3 .github/workflows/puppeteer/serve.py --no-browser --root `pwd`/${{matrix.dir}}tmp & | |
cd .github/workflows/puppeteer | |
node puppeteer.js | (grep 'ALL TESTS PASSED') | |
exit $? | |
- name: Test project | |
if: ${{ endsWith(matrix.dir, 'Web/') == false }} | |
shell: bash | |
run: | | |
cd ${{matrix.dir}} | |
godot --headless --quit-after 5000 | ( ! grep FAIL) | |
exit $? |