fix 0 voting period #1957
Workflow file for this run
This file contains hidden or 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: "rust workflow" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| # If new code is pushed to a PR branch, then cancel in progress workflows for | |
| # that PR. Ensures that we don't waste CI time, and returns results quicker. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # Not needed in CI, should make things a bit faster | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_TERM_COLOR: always | |
| # Remove unnecessary WASM build artifacts | |
| WASM_BUILD_CLEAN_TARGET: 1 | |
| # Enable sscache | |
| RUSTC_WRAPPER: "sccache" | |
| SCCACHE_GHA_ENABLED: "true" | |
| SCCACHE_CACHE_SIZE: "50GB" | |
| jobs: | |
| clippy-fmt-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: git checkout | |
| uses: actions/checkout@v4 | |
| # This job is a required status check, so it must always run (no | |
| # workflow-level path filter) to report on every PR — including | |
| # markdown-only ones. Otherwise the required check sits forever at | |
| # "Expected — waiting for status to be reported" and blocks the merge. | |
| # The heavy steps below are gated on an actual code change instead, so | |
| # docs-only PRs finish in seconds while still reporting success. | |
| - name: Detect code changes | |
| id: changes | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| # `code` is exposed as steps.changes.outputs.code below and is | |
| # true whenever any non-markdown file changed. | |
| code: | |
| - '!**/*.md' | |
| - name: Run sccache | |
| if: steps.changes.outputs.code == 'true' | |
| uses: mozilla-actions/sccache-action@v0.0.8 | |
| - name: install rust toolchain | |
| if: steps.changes.outputs.code == 'true' | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable, nightly | |
| components: clippy, rustfmt, llvm-tools-preview | |
| target: wasm32v1-none | |
| - name: Install cargo-llvm-cov | |
| if: steps.changes.outputs.code == 'true' | |
| run: cargo install cargo-llvm-cov | |
| - name: Check format | |
| if: steps.changes.outputs.code == 'true' | |
| run: cargo +nightly fmt --all -- --check | |
| - name: Check clippy | |
| if: steps.changes.outputs.code == 'true' | |
| run: cargo +stable clippy --release --locked --all-targets -- -D warnings | |
| # TODO: re-enable this after we find a stable solution to same name functions across multiple contracts | |
| # - name: Check build | |
| # run: cargo build --target wasm32v1-none --release | |
| - name: Run tests with coverage | |
| if: steps.changes.outputs.code == 'true' | |
| run: cargo +stable llvm-cov --workspace --lcov --fail-under-lines 90 --output-path lcov.info | |
| - name: Upload coverage to Codecov | |
| if: steps.changes.outputs.code == 'true' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./lcov.info | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: OpenZeppelin/stellar-contracts | |
| verbose: true |