This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
Increase coverage for bitcoin_client.rs #560
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: Pull Request | |
on: | |
pull_request: | |
branches: "main" | |
paths-ignore: ['**.md'] | |
push: | |
branches: "main" | |
paths-ignore: ['**.md'] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
generate-lockfile: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: cargo generate-lockfile -v | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Cargo.lock | |
path: Cargo.lock | |
linter: | |
needs: generate-lockfile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Cargo.lock | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
- uses: davidB/rust-cargo-make@v1 | |
with: | |
version: "0.36.13" | |
- name: Lint | |
run: cargo make --profile github-actions format | |
coverage: | |
needs: clarinet | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Cargo.lock | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- uses: davidB/rust-cargo-make@v1 | |
with: | |
version: "0.36.13" | |
- name: Coverage | |
run: cargo make --profile github-actions coverage-lcov | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage/lcov.info | |
fail_ci_if_error: true | |
clarinet: | |
needs: linter | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
components: rustfmt | |
override: true | |
- name: Install clarinet develop version | |
run: chmod +x ./romeo/asset-contract/scripts/install_clarinet_action.sh && ./romeo/asset-contract/scripts/install_clarinet_action.sh | |
- name: Run unit tests for romeo | |
working-directory: ./romeo/asset-contract | |
run: ./scripts/test.sh | |
- name: Print coverage report | |
working-directory: ./romeo/asset-contract | |
run: sudo apt-get install -qq -y lcov html2text > /dev/null && genhtml --branch-coverage .coverage/lcov.info -o .coverage/ && html2text .coverage/contracts/index.html | |
- name: "Export romeo code coverage" | |
uses: codecov/codecov-action@v3 | |
with: | |
directory: ./romeo/asset-contract/.coverage/ | |
files: lcov.info | |
verbose: false | |
flags: unittests | |
ignore: tests | |
devenv: | |
timeout-minutes: 120 | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
steps: | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
devenv: | |
- 'devenv/**' | |
- name: Checkout | |
if: steps.changes.outputs.devenv == 'true' | |
uses: actions/checkout@v3 | |
- name: Build devenv containers | |
if: steps.changes.outputs.devenv == 'true' | |
run: ./devenv/build.sh | |
vitest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Use Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
cache-dependency-path: ./romeo/asset-contract/package-lock.json | |
- run: npm ci | |
working-directory: ./romeo/asset-contract | |
- run: npm run test | |
working-directory: ./romeo/asset-contract | |