Skip to content

Solana deployment scripts and module configs #25

Solana deployment scripts and module configs

Solana deployment scripts and module configs #25

name: Cross-chain Solana
on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- main
paths:
- "cross-chain/solana/**"
- ".github/workflows/cross-chain-solana.yml"
pull_request:
jobs:
contracts-detect-changes:
runs-on: ubuntu-latest
outputs:
path-filter: ${{ steps.filter.outputs.path-filter }}
steps:
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
- uses: dorny/paths-filter@v2
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
path-filter:
- './cross-chain/solana/**'
- './.github/workflows/cross-chain-solana.yml'
contracts-build-and-test:
needs: contracts-detect-changes
if: |
github.event_name != 'pull_request'
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cross-chain/solana
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
cache-dependency-path: cross-chain/solana/yarn.lock
# A workaround for transitive dependencies that use the obsolete git://
# prefix instead of the recommended https://
- name: Configure git to not use unauthenticated protocol
run: git config --global url."https://".insteadOf git://
- name: Install Rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Install Anchor
run: |
cargo install --git https://github.com/coral-xyz/anchor --tag v0.28.0 anchor-cli --locked
- name: Install dependencies
run: yarn install
- name: Install Solana and run tests
run: |
sh -c "$(curl -sSfL https://release.solana.com/v1.16.5/install)"
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana config set -u localhost
solana config get
ls ~/.config/solana
echo "[132,196,51,204,234,79,135,213,169,81,250,90,73,168,28,41,193,49,153,71,192,44,228,74,230,78,211,95,54,241,137,50,119,155,54,147,229,137,197,57,146,111,140,177,222,54,120,254,254,250,191,135,251,47,163,16,180,160,110,108,54,111,84,76]" >> ~/.config/solana/id.json
yarn build
yarn test
contracts-format:
needs: contracts-detect-changes
if: |
github.event_name == 'push'
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cross-chain/solana
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "yarn"
cache-dependency-path: cross-chain/solana/yarn.lock
# A workaround for transitive dependencies that use the obsolete git://
# prefix instead of the recommended https://
- name: Configure git to not use unauthenticated protocol
run: git config --global url."https://".insteadOf git://
- name: Install dependencies
run: yarn install
- name: Check formatting
run: yarn format