Skip to content

Commit

Permalink
chore: Update ci (tokio-rs#854)
Browse files Browse the repository at this point in the history
* chore: Fix yaml indent

* chore: Replace arduino/setup-protoc with taiki-e/install-action

* chore: Remove unused git submodule

* chore: Remove outdated disabled ci job

* chore: Refactor ci job step name

* chore: Replace seanmiddleditch/gha-setup-ninja with in-tree action

* chore: Change ci name short

---------

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
  • Loading branch information
tottoto and LucioFranco authored Aug 14, 2023
1 parent 65451cc commit 9c877ce
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 75 deletions.
17 changes: 17 additions & 0 deletions .github/actions/setup-ninja/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
runs:
using: "Composite"
steps:
- name: install ninja
if: runner.os == 'macOS'
run: brew install ninja
shell: bash

- name: install ninja
if: runner.os == 'Windows'
run: choco install ninja
shell: bash

- name: install ninja
if: runner.os == 'Linux'
run: sudo apt-get install ninja-build
shell: bash
Original file line number Diff line number Diff line change
@@ -1,65 +1,26 @@
name: continuous integration
name: CI
on: pull_request

env:
PROTOC_VERSION: 3.20.3

jobs:

rustfmt:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: install toolchain
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: rustfmt
run: cargo fmt --all --check
# Disabled because downstream crates don't check this as well
# minversions:
# runs-on: ubuntu-latest
# steps:
# - uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: nightly
# - uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# - uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: Install Protoc
# uses: arduino/setup-protoc@v1
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - name: install ninja
# uses: seanmiddleditch/gha-setup-ninja@v3
# - name: cargo update -Zminimal-versions
# uses: actions-rs/cargo@v1
# with:
# command: update
# toolchain: nightly
# args: -Zminimal-versions
# - name: cargo check
# uses: actions-rs/cargo@v1
# with:
# command: check
# args: --workspace --all-targets
# toolchain: stable
components: rustfmt
- run: cargo fmt --all --check

machete:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: install toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-machete
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: install cargo-machete
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-machete
Expand All @@ -78,20 +39,17 @@ jobs:
- macos-latest
- windows-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: install toolchain
- uses: actions/checkout@v3
- name: install toolchain (${{ matrix.toolchain }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Install Protoc
uses: arduino/setup-protoc@v1
toolchain: ${{ matrix.toolchain }}
- name: install protoc
uses: taiki-e/install-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tool: protoc@${{ env.PROTOC_VERSION }}
- name: install ninja
uses: seanmiddleditch/gha-setup-ninja@v3
uses: ./.github/actions/setup-ninja
- uses: Swatinem/rust-cache@v2
- name: test
run: cargo test --workspace --all-targets
Expand All @@ -100,14 +58,13 @@ jobs:
# Run doc tests separately: https://github.com/rust-lang/cargo/issues/6669
- name: test doc
run: cargo test --workspace --doc
- name: test doc
- name: test doc no-default-features
run: cargo test -p prost-build -p prost-derive -p prost-types --doc --no-default-features

kani:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
- name: Verify with Kani
uses: model-checking/kani-github-action@v0.32
with:
Expand All @@ -127,16 +84,12 @@ jobs:
no-std:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: install toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- name: install protoc
uses: taiki-e/install-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tool: protoc@${{ env.PROTOC_VERSION }}
- uses: Swatinem/rust-cache@v2
- name: install cargo-no-std-check
uses: baptiste0928/cargo-install@v2
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

0 comments on commit 9c877ce

Please sign in to comment.