Skip to content

Commit

Permalink
Simplify GitHub CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Mar 13, 2024
1 parent e9c8fa9 commit e8bf950
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 57 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/release-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,12 @@ jobs:
TARGET_FLAGS: ""

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{matrix.target}}

- uses: actions/checkout@v4
- run: rustup default nightly && rustup target add ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Configure cross
if: matrix.cargo == 'cross'
run: |
cargo install cross
uses: taiki-e/install-action@cross
- name: Show commands
run: |
echo pwd:
Expand All @@ -81,7 +68,6 @@ jobs:
echo "cargo command is: ${{ matrix.cargo }}"
echo "target flags are: ${{ env.TARGET_FLAGS }}"
echo "target dir is: ${{ env.TARGET_DIR }}"
# Perform build
- name: Build binary
run: ${{ matrix.cargo }} build --release --verbose --target ${{ matrix.target }}
Expand Down
52 changes: 13 additions & 39 deletions .github/workflows/validation-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,9 @@ jobs:
env:
MAKE_DIST: "1"
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{matrix.target}}
- uses: actions/checkout@v4
- run: rustup default 1.74 && rustup component add clippy && rustup target add ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --all-features --all-targets --target ${{ matrix.target }} -- -D warnings
- name: Run tests
Expand Down Expand Up @@ -153,43 +143,27 @@ jobs:
name: "Format (cargo fmt)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: actions/checkout@v4
- run: rustup default nightly && rustup component add rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check

doc:
name: "Docs (cargo doc)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@nightly
- uses: actions/checkout@v4
- run: rustup default nightly
- uses: Swatinem/rust-cache@v2
- run: cargo doc --document-private-items

outdated:
name: Outdated
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/install@cargo-outdated
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cargo-outdated
- run: cargo outdated --workspace --exit-code 1

0 comments on commit e8bf950

Please sign in to comment.