Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update ci #854

Merged
merged 8 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]
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.