From 5bd6bd005dbd56eab72b6c5d3217ee46a5ab08dd Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Fri, 14 Aug 2020 19:55:43 +0000 Subject: [PATCH 1/2] Move optional checks to the end. While there, align style with the test framework. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 77 +++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 953fc234..af4c553a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -41,32 +41,6 @@ jobs: export PATH=$PATH:$(go env GOPATH)/bin addlicense -check . - audit: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Run cargo audit - run: | - cp -p cargo/Cargo.lock . - cargo audit - - outdated: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Run cargo outdated - run: cargo outdated --exit-code 1 - - - name: Check freshness of cargo/Cargo.lock - run: | - cargo generate-lockfile - mv Cargo.lock cargo/ - git diff --exit-code - stable: runs-on: ubuntu-latest @@ -80,13 +54,13 @@ jobs: - name: Build env: - RUSTFLAGS: -C link-args=-S -D warnings - run: cargo build --target=wasm32-unknown-unknown --release --all-targets + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo build --release --all-targets --target=wasm32-unknown-unknown - name: Format (clippy) env: - RUSTFLAGS: -C link-args=-S -D warnings - run: cargo clippy --target=wasm32-unknown-unknown --release --all-targets + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown - name: Format (rustfmt) run: cargo fmt -- --check @@ -110,28 +84,29 @@ jobs: run: | rustup toolchain install nightly --component clippy --component rustfmt rustup +nightly target add wasm32-unknown-unknown + rustup default nightly - name: Build env: - RUSTFLAGS: -C link-args=-S -D warnings - run: cargo +nightly build --target=wasm32-unknown-unknown --release --all-targets + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo build --release --all-targets --target=wasm32-unknown-unknown - name: Format (clippy) env: - RUSTFLAGS: -C link-args=-S -D warnings - run: cargo +nightly clippy --target=wasm32-unknown-unknown --release --all-targets + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown - name: Format (rustfmt) - run: cargo +nightly fmt -- --check + run: cargo fmt -- --check - name: Format (manifest) - run: cargo +nightly verify-project + run: cargo verify-project - name: Package (docs) - run: cargo +nightly doc --no-deps --target=wasm32-unknown-unknown + run: cargo doc --no-deps --target=wasm32-unknown-unknown - name: Package (publish) - run: cargo +nightly publish --dry-run --target=wasm32-unknown-unknown + run: cargo publish --dry-run --target=wasm32-unknown-unknown bazel: runs-on: ubuntu-latest @@ -171,3 +146,29 @@ jobs: cargo raze --output=cargo mv Cargo.lock cargo/ git diff --exit-code + + outdated: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Run cargo outdated + run: cargo outdated --exit-code 1 + + - name: Check freshness of cargo/Cargo.lock + run: | + cargo generate-lockfile + mv Cargo.lock cargo/ + git diff --exit-code + + audit: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Run cargo audit + run: | + cp -p cargo/Cargo.lock . + cargo audit From 391b622c52201f8bae279799e2c8ca64eaf2da8e Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Fri, 14 Aug 2020 19:56:17 +0000 Subject: [PATCH 2/2] review: move up Bazel build. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 77 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index af4c553a..7b669c70 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -41,6 +41,44 @@ jobs: export PATH=$PATH:$(go env GOPATH)/bin addlicense -check . + bazel: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/bin + ~/.cargo/registry + key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'cargo/Cargo.lock') }} + + - name: Build + run: bazelisk build //... + + - name: Format (buildifier) + run: | + GO111MODULE=on go get -u github.com/bazelbuild/buildtools/buildifier@3.4.0 + export PATH=$PATH:$(go env GOPATH)/bin + buildifier -mode=check WORKSPACE + buildifier -mode=check BUILD + buildifier -mode=check examples/BUILD + + - name: Format (cargo raze) + run: | + cargo install cargo-raze --version 0.3.8 + cp -p cargo/Cargo.lock . + rm -rf cargo/ + cargo raze --output=cargo + mv Cargo.lock cargo/ + git diff --exit-code + stable: runs-on: ubuntu-latest @@ -108,45 +146,6 @@ jobs: - name: Package (publish) run: cargo publish --dry-run --target=wasm32-unknown-unknown - bazel: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Cache - uses: actions/cache@v2 - with: - path: | - ~/.cache/bazel - ~/.cache/bazelisk - ~/.cargo/.crates.toml - ~/.cargo/.crates2.json - ~/.cargo/bin - ~/.cargo/registry - key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'cargo/Cargo.lock') }} - - - name: Build - run: | - bazelisk build //... - - - name: Format (buildifier) - run: | - GO111MODULE=on go get -u github.com/bazelbuild/buildtools/buildifier@3.4.0 - export PATH=$PATH:$(go env GOPATH)/bin - buildifier -mode=check WORKSPACE - buildifier -mode=check BUILD - buildifier -mode=check examples/BUILD - - - name: Format (cargo raze) - run: | - cargo install cargo-raze --version 0.3.8 - cp -p cargo/Cargo.lock . - rm -rf cargo/ - cargo raze --output=cargo - mv Cargo.lock cargo/ - git diff --exit-code - outdated: runs-on: ubuntu-latest