Skip to content

feat: add oracle exchange rate query #82

feat: add oracle exchange rate query

feat: add oracle exchange rate query #82

Workflow file for this run

name: Rust tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
rust-test:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Rust caches
uses: actions/cache@v3
id: rust-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Run tests
# Test all packages
run: cargo test --all --verbose
# Test single package (e.g. contracts/whitelist)
# run: cargo test --package whitelist --verbose
rust-build:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Rust caches
uses: actions/cache@v3
id: rust-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Compile all Rust code in workspace
run: cargo build
coverage:
if: github.event_name != 'push' || github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
name: ubuntu / stable / coverage
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Rust caches
uses: actions/cache@v3
id: rust-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov
# Outputs the code coverage in a format that codecov.io can understand
run: cargo llvm-cov --lcov --output-path lcov.info
# run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true