Create tech stack docs (techstack.yml and techstack.md) #2
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: Continuous integration | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
test-desktop: | |
name: Build and test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
args: [ | |
"--no-default-features", | |
"--all-features", | |
"--benches --all-features", | |
] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0 | |
with: | |
key: ${{ matrix.args }} | |
- run: cargo test --workspace ${{ matrix.args }} | |
test-wasm: | |
name: Build on WASM | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: [ | |
wasm32-unknown-emscripten, | |
wasm32-wasi | |
] | |
include: | |
- toolchain: wasm32-unknown-unknown | |
args: "--features wasm-bindgen" | |
env: | |
CC: clang-11 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- uses: actions/checkout@v3 | |
- name: Install Rust ${{ matrix.toolchain }} | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
toolchain: stable | |
target: ${{ matrix.toolchain }} | |
override: true | |
- name: Install a recent version of clang | |
run: | | |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" | |
- name: Install CMake | |
run: sudo apt-get install -y cmake | |
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0 | |
with: | |
key: ${{ matrix.toolchain }} | |
- name: Build on ${{ matrix.toolchain }} | |
# TODO: also run `cargo test` | |
# TODO: ideally we would build `--workspace`, but not all crates compile for WASM | |
run: cargo build --target=${{ matrix.toolchain }} ${{ matrix.args }} | |
check-rustdoc-links: | |
name: Check rustdoc intra-doc links | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0 | |
- name: Check rustdoc links | |
run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items --all-features | |
check-clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: clippy | |
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0 | |
- name: Run cargo clippy | |
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 | |
with: | |
command: custom-clippy # cargo alias to allow reuse of config locally | |
integration-test: | |
name: Integration tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0 | |
- name: Run ipfs-kad example | |
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- name: Check formatting | |
run: cargo fmt -- --check |