Solana deployment scripts and module configs #12
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: 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" | |
source /home/runner/.profile | |
source /home/runner/.bash_profile | |
source /home/runner/.bashrc | |
cat /home/runner/.profile | |
cat /home/runner/.bash_profile | |
cat /home/runner/.bashrc | |
echo $PATH | |
- name: Checking Solana version | |
run: solana --version | |
- 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: yarn build | |
- name: Run tests | |
run: 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 |