mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-25 11:02:12 +00:00
Finish the migration to GitHub Actions (#1500)
This commit is contained in:
parent
7bf5266a02
commit
42290d94f2
@ -1,114 +0,0 @@
|
||||
version: 2
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- test
|
||||
- test-wasm
|
||||
- check-rustdoc-links
|
||||
- integration-test
|
||||
|
||||
jobs:
|
||||
test:
|
||||
machine:
|
||||
enabled: true
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Enable ipv6
|
||||
command: |
|
||||
cat <<'EOF' | sudo tee /etc/docker/daemon.json
|
||||
{
|
||||
"ipv6": true,
|
||||
"fixed-cidr-v6": "2001:db8:1::/64"
|
||||
}
|
||||
EOF
|
||||
sudo service docker restart
|
||||
- restore_cache:
|
||||
key: test-cache
|
||||
- run:
|
||||
name: Prepare docker container for building
|
||||
command: docker build --pull --no-cache -t rust-libp2p -f .circleci/images/rust-libp2p/Dockerfile .
|
||||
- run:
|
||||
name: Run tests, inside a docker image, with no feature
|
||||
command: docker run --rm -v "/cache/cargo/registry:/usr/local/cargo/registry" -v "/cache/target:/app/target" -it rust-libp2p cargo test --all --no-default-features
|
||||
- run:
|
||||
name: Run tests, inside a docker image, with all features
|
||||
command: docker run --rm -v "/cache/cargo/registry:/usr/local/cargo/registry" -v "/cache/target:/app/target" -it rust-libp2p cargo test --all --all-features
|
||||
- save_cache:
|
||||
key: test-cache
|
||||
paths:
|
||||
- "/cache"
|
||||
|
||||
check-rustdoc-links:
|
||||
docker:
|
||||
- image: rust:latest
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: test-rustdoc-cache-{{ epoch }}
|
||||
- run:
|
||||
name: Install nightly Rust
|
||||
# TODO: intra-doc links are available on nightly only
|
||||
# see https://doc.rust-lang.org/nightly/rustdoc/lints.html#intra_doc_link_resolution_failure
|
||||
command: rustup default nightly
|
||||
- run:
|
||||
name: Print Rust version
|
||||
command: |
|
||||
rustc --version
|
||||
- run:
|
||||
name: Check Rustdoc links
|
||||
command: RUSTDOCFLAGS="--deny intra_doc_link_resolution_failure" cargo +nightly doc --verbose --workspace --no-deps --document-private-items
|
||||
- save_cache:
|
||||
key: test-rustdoc-cache-{{ epoch }}
|
||||
paths:
|
||||
- ./target
|
||||
- /usr/local/cargo
|
||||
|
||||
test-wasm:
|
||||
docker:
|
||||
- image: parity/rust-builder:latest
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- test-wasm-cache-{{ epoch }}
|
||||
- run:
|
||||
name: Print Rust version
|
||||
command: |
|
||||
rustc --version
|
||||
- run:
|
||||
name: Build for wasm32
|
||||
# TODO: also run tests but with --no-run; important to detect linking errors
|
||||
command: |
|
||||
sccache -s
|
||||
cargo web build
|
||||
sccache -s
|
||||
- save_cache:
|
||||
key: test-wasm-cache-{{ epoch }}
|
||||
paths:
|
||||
- ./target
|
||||
- /usr/local/cargo
|
||||
- /root/.cache/sccache
|
||||
|
||||
integration-test:
|
||||
docker:
|
||||
- image: rust
|
||||
- image: ipfs/go-ipfs
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: integration-test-cache-{{ epoch }}
|
||||
- run:
|
||||
name: Print Rust version
|
||||
command: |
|
||||
rustc --version
|
||||
- run:
|
||||
command: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad
|
||||
- save_cache:
|
||||
key: integration-test-cache-{{ epoch }}
|
||||
paths:
|
||||
- "~/.cargo"
|
||||
- "./target"
|
||||
|
@ -1,5 +0,0 @@
|
||||
FROM rust
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
COPY . /app
|
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@ -3,7 +3,7 @@ name: Continuous integration
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
@ -88,3 +88,28 @@ jobs:
|
||||
run: rustup default nightly
|
||||
- name: Check rustdoc links
|
||||
run: RUSTDOCFLAGS="--deny intra_doc_link_resolution_failure" cargo +nightly doc --verbose --workspace --no-deps --document-private-items
|
||||
|
||||
integration-test:
|
||||
name: Integration tests
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: rust
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: cargo-registry-${{ hashFiles('Cargo.toml') }}
|
||||
- name: Cache cargo index
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: cargo-index-${{ hashFiles('Cargo.toml') }}
|
||||
- name: Cache cargo build
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: target
|
||||
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
|
||||
- name: Run ipfs-kad example
|
||||
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad
|
||||
|
Loading…
x
Reference in New Issue
Block a user