diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f91a9bc..7525dde 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,14 +1,20 @@ +permissions: + contents: read on: push: branches: [main] pull_request: +# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: check jobs: fmt: runs-on: ubuntu-latest name: stable / fmt steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable @@ -16,19 +22,19 @@ jobs: with: components: rustfmt - name: cargo fmt --check - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --check + run: cargo fmt --check clippy: runs-on: ubuntu-latest name: ${{ matrix.toolchain }} / clippy + permissions: + contents: read + checks: write strategy: fail-fast: false matrix: toolchain: [stable, beta] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install ${{ matrix.toolchain }} @@ -44,44 +50,39 @@ jobs: runs-on: ubuntu-latest name: nightly / doc steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly - name: cargo doc - uses: actions-rs/cargo@v1 - with: - command: doc - args: --no-deps --all-features + run: cargo doc --no-deps --all-features env: RUSTDOCFLAGS: --cfg docsrs hack: runs-on: ubuntu-latest name: ubuntu / stable / features steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack + # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 - name: cargo hack - uses: actions-rs/cargo@v1 - with: - command: hack - args: --feature-powerset check --lib --tests + run: cargo hack --feature-powerset check msrv: runs-on: ubuntu-latest # we use a matrix here just because env can't be used in job names # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability strategy: matrix: - msrv: [1.57.0] # base64 0.21 requires 1.57 + msrv: ["1.57.0"] # base64 0.21 requires 1.57 name: ubuntu / ${{ matrix.msrv }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install ${{ matrix.msrv }} @@ -89,6 +90,4 @@ jobs: with: toolchain: ${{ matrix.msrv }} - name: cargo +${{ matrix.msrv }} check - uses: actions-rs/cargo@v1 - with: - command: check + run: cargo check diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index c7a7686..26b877f 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -1,9 +1,15 @@ +permissions: + contents: read on: push: branches: [main] pull_request: schedule: - cron: '7 7 * * *' +# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: rolling jobs: # https://twitter.com/mycoliza/status/1571295690063753218 @@ -11,21 +17,16 @@ jobs: runs-on: ubuntu-latest name: ubuntu / nightly steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile - name: cargo test --locked - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --features test-full-imap --all-targets + run: caro test --locked --features test-full-imap --all-targets services: cyrus_imapd: image: outoforder/cyrus-imapd-tester:latest @@ -43,7 +44,7 @@ jobs: # Unfortunately, hashFiles only works in if on steps, so we reepeat it. # if: hashFiles('Cargo.lock') != '' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install beta @@ -51,15 +52,10 @@ jobs: uses: dtolnay/rust-toolchain@beta - name: cargo update if: hashFiles('Cargo.lock') != '' - uses: actions-rs/cargo@v1 - with: - command: update + run: cargo update - name: cargo test if: hashFiles('Cargo.lock') != '' - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --features test-full-imap --all-targets + run: cargo test --locked --features test-full-imap --all-targets env: RUSTFLAGS: -D deprecated services: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e124bc..d44634a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,13 @@ +permissions: + contents: read on: push: branches: [main] pull_request: +# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: test jobs: greenmail: @@ -11,7 +17,7 @@ jobs: matrix: toolchain: [stable, beta] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install ${{ matrix.toolchain }} @@ -20,15 +26,10 @@ jobs: toolchain: ${{ matrix.toolchain }} - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --all-targets + run: cargo test --locked --all-targets services: greenmail: image: greenmail/standalone:1.6.8 @@ -48,26 +49,22 @@ jobs: matrix: toolchain: [stable, beta] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install ${{ matrix.toolchain }} - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.toolchain }} - default: true - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --features test-full-imap --all-targets + run: cargo test --locked --features test-full-imap --all-targets + # https://github.com/rust-lang/cargo/issues/6669 + - name: cargo test --doc + run: cargo test --locked --all-features --doc services: cyrus_imapd: image: outoforder/cyrus-imapd-tester:latest @@ -80,7 +77,7 @@ jobs: runs-on: ubuntu-latest name: ubuntu / stable / minimal-versions steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable @@ -90,16 +87,9 @@ jobs: - name: rustup default stable run: rustup default stable - name: cargo update -Zminimal-versions - uses: actions-rs/cargo@v1 - with: - command: update - toolchain: nightly - args: -Zminimal-versions + run: cargo +nightly update -Zminimal-versions - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --features test-full-imap --all-targets + run: cargo test --locked --features test-full-imap --all-targets services: cyrus_imapd: image: outoforder/cyrus-imapd-tester:latest @@ -120,26 +110,21 @@ jobs: if: runner.os == 'Windows' - run: vcpkg install openssl:x64-windows-static-md if: runner.os == 'Windows' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile - name: cargo check - uses: actions-rs/cargo@v1 - with: - command: check - args: --locked --all-features --all-targets + run: cargo check --locked --all-features --all-targets coverage: runs-on: ubuntu-latest name: ubuntu / stable / coverage steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable @@ -150,9 +135,7 @@ jobs: uses: taiki-e/install-action@cargo-llvm-cov - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile - name: cargo llvm-cov run: cargo llvm-cov --features test-full-imap --lcov --output-path lcov.info - name: Upload to codecov.io