Skip to content

Switch to near-gas #602

Switch to near-gas

Switch to near-gas #602

Workflow file for this run

name: ci
on:
pull_request:
branches: [master]
# schedule:
# - cron: '00 01 * * *'
jobs:
tests:
name: tests
env:
# For some builds, we use cross to test on 32-bit and big-endian
# systems.
CARGO: cargo
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
TARGET_FLAGS: ""
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
TARGET_DIR: ./target
# For some builds, we disable ledger support
FEATURES_FLAGS: "--features self-update"
# Emit backtraces on panics.
RUST_BACKTRACE: 1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- build: linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
- build: linux-x86_64-musl
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
- build: linux-aarch64-musl
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
- build: macos-x86_64
os: macos-latest
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-latest
target: aarch64-apple-darwin
- build: win64-msvc
os: windows-2019
target: x86_64-pc-windows-msvc
- build: win32-msvc
os: windows-2019
target: i686-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}
- name: Use Cross
if: matrix.os == 'ubuntu-20.04'
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
if [ -d "./cross/${{ matrix.target }}" ]; then
docker build --tag "cross:${{ matrix.target }}" "./cross/${{ matrix.target }}"
fi
- name: Setup target flags
run: |
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Disable Ledger support for platforms that don't have udev
if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'
run: |
echo "FEATURES_FLAGS=${{ env.FEATURES_FLAGS }} --no-default-features" >> $GITHUB_ENV
- name: Show command used for Cargo
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
- name: Build near-cli-rs crate
run: ${{ env.CARGO }} build --verbose --all ${{ env.TARGET_FLAGS }} ${{ env.FEATURES_FLAGS }}
- name: Run tests
if: matrix.build != 'macos-aarch64'
run: ${{ env.CARGO }} test --verbose --all ${{ env.TARGET_FLAGS }} ${{ env.FEATURES_FLAGS }}
- name: View account summary for 'fro_volod.testnet'
if: matrix.build != 'linux-aarch64-musl' && matrix.build != 'macos-aarch64'
run: |
${{ env.TARGET_DIR }}/debug/near account view-account-summary fro_volod.testnet network-config testnet now
- name: Transfer NEAR Tokens
if: matrix.build != 'linux-aarch64-musl' && matrix.build != 'macos-aarch64'
run: |
${{ env.TARGET_DIR }}/debug/near tokens volodymyr.testnet send-near fro_volod.testnet '0.1 NEAR' network-config testnet sign-with-plaintext-private-key --signer-public-key ed25519:Ebx7NiwqupsshnUsEZCzgm84SQqi8LZWJx7ermrr14JF --signer-private-key ed25519:2qM8v3nF4opam1frweMmD5h4PM3H6jtxfuAE77rpEuUx2rSGj64AzDf9xPKG76bgAs5L1oecV93etPy6xKjds2YB display
codestyle:
name: Code Style (fmt + clippy)
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
- name: Check formatting
run: |
cargo fmt --all -- --check
- name: Install libudev-dev
run: |
sudo apt-get update
sudo apt-get install --assume-yes libudev-dev
- name: Check lints (cargo clippy)
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features