Skip to content

Add an increment example which can be paused by a dependency #982

Add an increment example which can be paused by a dependency

Add an increment example which can be paused by a dependency #982

Workflow file for this run

name: Rust
on:
push:
branches: [main, dev]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true
env:
MINIMUM_RUST_VERSION: 1.79.0
jobs:
complete:
if: always()
needs: [fmt, build-and-test]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
dirs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: dirs
run: |
dirs=$(find . -type f -name 'Makefile' -mindepth 2 | xargs dirname | sed 's|^\./||' | jq -Rnc '[inputs | "\(.)"]')
echo "dirs=$dirs" >> $GITHUB_OUTPUT
outputs:
dirs: ${{ steps.dirs.outputs.dirs }}
fmt:
needs: dirs
strategy:
fail-fast: false
matrix:
working-directory: ${{ fromJSON(needs.dirs.outputs.dirs) }}
defaults:
run:
working-directory: ${{ matrix.working-directory }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update
- run: cargo fmt --all --check
build-and-test:
needs: dirs
strategy:
fail-fast: false
matrix:
working-directory: ${{ fromJSON(needs.dirs.outputs.dirs) }}
rust: [msrv, latest]
sys:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
defaults:
run:
working-directory: ${{ matrix.working-directory }}
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- name: Use the minimum supported Rust version
if: matrix.rust == 'msrv'
run: |
rustup override set $MINIMUM_RUST_VERSION
rustup component add clippy --toolchain $MINIMUM_RUST_VERSION
- name: Error on warnings and clippy checks
# Only error on warnings and checks for the msrv, because new versions of
# Rust will frequently add new warnings and checks.
if: matrix.rust == 'msrv'
run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV
- run: rustup update
- run: cargo version
- run: rustup target add ${{ matrix.sys.target }}
- run: rustup target add wasm32-unknown-unknown
- uses: stellar/stellar-cli@4b2738e96f955904a9cf815e0a0bb947bf8201eb
with:
version: 21.5.3
- run: make test
env:
CARGO_BUILD_TARGET: ${{ matrix.sys.target }}