Skip to content

Commit

Permalink
ci: Update rules
Browse files Browse the repository at this point in the history
- Refuse unmaintained actions-rs
- Update rust-cache actions
- Cancel previous in-progress runs
- Remove mips targets from ci
  • Loading branch information
katyo committed Jan 11, 2024
1 parent ed34bc2 commit fdd99ac
Showing 1 changed file with 43 additions and 72 deletions.
115 changes: 43 additions & 72 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,79 +7,59 @@ on:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
profile: minimal
toolchain: stable
components: rustfmt
default: true
override: true
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rust-docs
default: true
override: true
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Documentation
uses: actions-rs/cargo@v1
env:
DOCS_RS: 1
with:
command: doc
args: --all --all-features
run: cargo doc --all --all-features

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
profile: minimal
components: clippy
default: true
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all --all-targets
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all --all-targets

# minver:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# - uses: dtolnay/rust-toolchain@v1
# with:
# toolchain: nightly
# profile: minimal
# default: true
# override: true
# - uses: Swatinem/rust-cache@v1
# - uses: actions-rs/cargo@v1
# with:
# command: check
# args: --all --all-features --all-targets -Z minimal-versions
# - uses: Swatinem/rust-cache@v2
# - run: cargo check --all --all-features --all-targets -Z minimal-versions

test:
needs:
Expand Down Expand Up @@ -132,26 +112,26 @@ jobs:
target: aarch64-unknown-linux-gnu
features: default
test_args: --no-run
- task: test
rust: stable
target: mips-unknown-linux-gnu
features: default
test_args: --no-run
- task: test
rust: stable
target: mips64-unknown-linux-gnuabi64
features: default
test_args: --no-run
- task: test
rust: stable
target: mipsel-unknown-linux-gnu
features: default
test_args: --no-run
- task: test
rust: stable
target: mips64el-unknown-linux-gnuabi64
features: default
test_args: --no-run
#- task: test
# rust: stable
# target: mips-unknown-linux-gnu
# features: default
# test_args: --no-run
#- task: test
# rust: stable
# target: mips64-unknown-linux-gnuabi64
# features: default
# test_args: --no-run
#- task: test
# rust: stable
# target: mipsel-unknown-linux-gnu
# features: default
# test_args: --no-run
#- task: test
# rust: stable
# target: mips64el-unknown-linux-gnuabi64
# features: default
# test_args: --no-run
- task: test
rust: stable
target: powerpc-unknown-linux-gnu
Expand Down Expand Up @@ -196,31 +176,23 @@ jobs:
echo "CC_${ENV_TARGET}=${GCC_TARGET}-gcc" >> $GITHUB_ENV
echo "CARGO_TARGET_${ENV_TARGET_UC}_LINKER=${GCC_TARGET}-gcc" >> $GITHUB_ENV
- name: Setup Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
profile: minimal
default: true
override: true
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Update deps
uses: actions-rs/cargo@v1
with:
command: update
run: cargo update
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }}
run: cargo build --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }}
- name: Test
uses: actions-rs/cargo@v1
timeout-minutes: 2
env:
RUST_BACKTRACE: full
with:
command: test
args: --all --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} ${{ matrix.test_args }}
run: cargo test --all --target ${{ matrix.target }} --no-default-features --features ${{ matrix.features }} ${{ matrix.test_args }}

publish:
if: github.repository == 'katyo/gpiod-rs' && startsWith(github.ref, 'refs/tags/')
Expand All @@ -230,10 +202,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
override: true
- name: Publish crates
uses: katyo/publish-crates@v1
with:
Expand Down

0 comments on commit fdd99ac

Please sign in to comment.