forked from yskopets/proxy-wasm-rust-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update cargo-raze to v0.9.2. (proxy-wasm#75)
Signed-off-by: Piotr Sikora <[email protected]>
- Loading branch information
1 parent
9a88749
commit 05194a6
Showing
20 changed files
with
222 additions
and
149 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,42 +45,40 @@ jobs: | |
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', 'bazel/cargo/Cargo.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} | ||
|
||
- name: Build (wasm32-unknown-unknown) | ||
run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasm //... | ||
|
||
- name: Build (wasm32-wasi) | ||
run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasi //... | ||
|
||
- name: Format (buildifier) | ||
run: | | ||
GO111MODULE=on go get -u github.com/bazelbuild/buildtools/[email protected] | ||
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.7.0 | ||
cp -p bazel/cargo/Cargo.lock . | ||
rm -rf bazel/cargo/ | ||
cargo raze --output=bazel/cargo | ||
mv Cargo.lock bazel/cargo/ | ||
git diff --exit-code | ||
- 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', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} | ||
|
||
- name: Build (wasm32-unknown-unknown) | ||
run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasm //... | ||
|
||
- name: Build (wasm32-wasi) | ||
run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasi //... | ||
|
||
- name: Format (buildifier) | ||
run: | | ||
GO111MODULE=on go get -u github.com/bazelbuild/buildtools/[email protected] | ||
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: | | ||
rm -rf bazel/cargo/ | ||
cargo install cargo-raze --version 0.9.2 | ||
cargo raze --generate-lockfile --output=bazel/cargo | ||
git diff --exit-code | ||
stable: | ||
runs-on: ubuntu-latest | ||
|
@@ -200,99 +198,13 @@ jobs: | |
- name: Run cargo outdated | ||
run: cargo outdated --root-deps-only --exit-code 1 | ||
|
||
- name: Check freshness of bazel/cargo/Cargo.lock | ||
run: | | ||
cargo generate-lockfile | ||
mv Cargo.lock bazel/cargo/ | ||
git diff --exit-code | ||
audit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run cargo audit | ||
run: | | ||
cp -p bazel/cargo/Cargo.lock . | ||
cargo audit | ||
docs: | ||
name: "Docs" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Install Rust" | ||
run: | | ||
rustup update stable | ||
rustup default stable | ||
rustc -vV | ||
- name: "Install 'wasm32-unknown-unknown'" | ||
run: | | ||
rustup target add wasm32-unknown-unknown | ||
- name: "Build docs" | ||
run: | | ||
cargo doc --no-deps --target=wasm32-unknown-unknown | ||
- name: "Publish GitHub Pages" | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/proxy-wasm-spec-0.1.0' }} | ||
run: | | ||
git fetch origin gh-pages # By default, 'actions/checkout' only fetches branch of the commit. | ||
git worktree add /tmp/rustdoc gh-pages # Checkout 'gh-pages' branch into '/tmp/rustdoc' | ||
rm -rf /tmp/rustdoc/* # Remove all files (except for hidden files, such as .git directory) | ||
cp -rp target/wasm32-unknown-unknown/doc/* /tmp/rustdoc/ | ||
cd /tmp/rustdoc | ||
git add --all # This adds, modifies, and removes index entries to match the working tree. | ||
if ! git diff --cached --exit-code ; then # There might be no changes to commit | ||
GIT_AUTHOR_NAME="${{ github.event.head_commit.author.name }}" \ | ||
GIT_AUTHOR_EMAIL="${{ github.event.head_commit.author.email }}" \ | ||
GIT_AUTHOR_DATE="${{ github.event.head_commit.timestamp }}" \ | ||
GIT_COMMITTER_NAME="${{ github.event.head_commit.committer.name }}" \ | ||
GIT_COMMITTER_EMAIL="${{ github.event.head_commit.committer.email }}" \ | ||
GIT_COMMITTER_DATE="${{ github.event.head_commit.timestamp }}" \ | ||
git commit -m "${{ github.event.head_commit.message }}" | ||
git push origin gh-pages | ||
else | ||
echo "There are no changes to GitHub Pages." | ||
fi | ||
git worktree remove --force /tmp/rustdoc # Remove the working tree. | ||
publish: | ||
name: "Publish Crate" | ||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | ||
needs: | ||
- stable | ||
- nightly | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Install Rust" | ||
run: | | ||
rustup update stable | ||
rustup default stable | ||
rustc -vV | ||
- name: "Install 'wasm32-unknown-unknown'" | ||
run: | | ||
rustup target add wasm32-unknown-unknown | ||
- name: "Check version" | ||
run: | | ||
version="$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | .version')" | ||
tag="${GITHUB_REF##*/}" | ||
if [[ "$version" != "$tag" ]]; then | ||
echo "Package version according to Cargo.toml ($version) is different from the Git tag ($tag). Did you forget to bump the version in Cargo.toml ?" | ||
exit 1 | ||
fi | ||
- name: "Publish" | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | ||
run: | | ||
cargo publish --target=wasm32-unknown-unknown | ||
- name: Run cargo audit | ||
run: | | ||
cp -p bazel/cargo/Cargo.raze.lock . | ||
cargo audit |
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
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
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
File renamed without changes.
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
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
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
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
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
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
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
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
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
Oops, something went wrong.