Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Stricter Linter

Stricter Linter #311

Workflow file for this run

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"
roolchain: stable, nightly
- 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
- 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