chore: add flatmap example (#68) #174
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: Rust | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Cache Cargo dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install protoc (for Protocol Buffers) | |
run: | | |
set -eux -o pipefail | |
PROTOC_VERSION=3.19.4 | |
PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip | |
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP | |
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc | |
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*' | |
sudo chmod +x /usr/local/bin/protoc | |
sudo find /usr/local/include -type f | xargs sudo chmod a+r | |
sudo find /usr/local/include -type d | xargs sudo chmod a+rx | |
rm -f $PROTOC_ZIP | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Check formatting | |
run: cargo fmt --all -- --check |