Skip to content

Commit

Permalink
Update GitHub actions (#1329)
Browse files Browse the repository at this point in the history
* Update actions GitHub audit workflow

- Use latest actions/checkout
- Switch to rustsec/audit-check from the unmaintained
  actions-rs/audit-check

* Fix rustdoc errors for the nightly toolchain

So that we don't have to shop for a specific nightly in the CI workflow.

* CI: Bump to checkout@v3, replace toolchain action

In all GitHub workflows:
- Bump actions/checkout to v3
- Replace actions-rs/toolchain with dtolnay/rust-toolchain

* CI: replace actions-rs/clippy-check

Replace the unmaintained action with giraffate/clippy-action@v1

* CI: update protoc to 23.4 and buf to 1.24

* Update grcov to 0.8.18
  • Loading branch information
mzabaluev authored Jul 17, 2023
1 parent c721b36 commit e930691
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 185 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache cargo bin
uses: actions/cache@v1
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-audit
- uses: actions-rs/audit-check@v1
- uses: actions/checkout@v3
- uses: rustsec/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
53 changes: 16 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,61 +21,42 @@ jobs:
tendermint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build-all
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build-all

build-light-client-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: build-wasm-tendermint
- uses: actions-rs/cargo@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
command: build-wasm-light-client
targets: wasm32-unknown-unknown
- run: cargo build-wasm-tendermint
- run: cargo build-wasm-light-client

tools:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build-tools
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo build-tools

# As per https://github.com/informalsystems/tendermint-rs/issues/1014
generated-protos-compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: |
curl -Lo /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
curl -Lo /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip
unzip /tmp/protoc.zip -d ${HOME}/.local
echo "PROTOC=${HOME}/.local/bin/protoc" >> $GITHUB_ENV
export PATH="${PATH}:${HOME}/.local/bin"
- name: Install buf
run: |
curl -sSL https://github.com/bufbuild/buf/releases/download/v1.18.0/buf-Linux-x86_64 \
curl -sSL https://github.com/bufbuild/buf/releases/download/v1.24.0/buf-Linux-x86_64 \
-o /usr/local/bin/buf
chmod +x /usr/local/bin/buf
- name: Regenerate proto definitions
Expand All @@ -84,6 +65,4 @@ jobs:
- name: Show the differences with checked-in files
run: git diff -- proto/src/prost
- name: Ensure that generated proto definitions compile
uses: actions-rs/cargo@v1
with:
command: build-all
run: cargo build-all
15 changes: 4 additions & 11 deletions .github/workflows/no-std.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ jobs:
name: Check no_std panic conflict
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: |
cd tools/no-std-check
make check-panic-conflict
Expand All @@ -24,12 +21,8 @@ jobs:
# name: Check no_std substrate support
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly
# target: wasm32-unknown-unknown
# override: true
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# - run: |
# cd tools/no-std-check
# make check-substrate
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
- name: Publish crates
run: ./release.sh
env:
Expand Down
54 changes: 19 additions & 35 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,58 +21,42 @@ jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt --all -- --check

# This job creates the "clippy-results" GitHub Action that lists the clippy results in a nice format.
clippy-json-output:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
- uses: giraffate/clippy-action@v1
with:
name: clippy-results
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -Dwarnings -Drust-2018-idioms
reporter: 'github-pr-check'
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --all-features --all-targets -- -Dwarnings -Drust-2018-idioms

clippy-tools-output:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
- uses: giraffate/clippy-action@v1
with:
name: clippy-tools-results
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path tools/kvstore-test/Cargo.toml --all-features --all-targets -- -Dwarnings -Drust-2018-idioms
reporter: 'github-pr-check'
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --manifest-path tools/kvstore-test/Cargo.toml --all-features --all-targets -- -Dwarnings -Drust-2018-idioms

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2023-03-01 # regression prevents docs from building
override: true
- uses: actions-rs/cargo@v1
env:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly # regression prevents docs from building on stable
- env:
RUSTDOCFLAGS: "--cfg docsrs"
with:
command: doc
args: --all-features
run: cargo doc --all-features
Loading

0 comments on commit e930691

Please sign in to comment.