Skip to content

Solana deployment scripts and module configs #16

Solana deployment scripts and module configs

Solana deployment scripts and module configs #16

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 Solana
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"
- 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: Build contracts
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
yarn build
- name: Run tests
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
solana-keygen new
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