diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7482e5c..1d35db8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 @@ -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/') @@ -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: