diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 4ab09e30e984..dace98fe34a9 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,8 +1,7 @@ name: Benchmark on: - pull_request: - branches: [master] - types: [opened, reopened, synchronize] + push: + branches: [master, staging, trying] concurrency: group: benchmark-${{ github.head_ref }} cancel-in-progress: true diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml new file mode 100644 index 000000000000..45d5819db859 --- /dev/null +++ b/.github/workflows/ci-pr.yml @@ -0,0 +1,62 @@ +name: CI-PR +on: + pull_request: + branches: [master] +concurrency: + group: ci-${{ github.head_ref }} + cancel-in-progress: true +jobs: + ci-pr: + name: CI-PR + needs: [test, msrv] + runs-on: ubuntu-latest + steps: + - name: Done + run: exit 0 + test: + name: Tests + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + rust: [stable] + runs-on: ${{ matrix.os }} + steps: + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - name: Cache Builds + uses: Swatinem/rust-cache@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Default features + run: cargo test --all-targets + - name: All features + Debug + run: cargo test --all-targets --features "wrap_help yaml regex debug" + - name: No features + run: cargo test --all-targets --no-default-features --features "std cargo" + msrv: + name: "Check MSRV: 1.54.0" + runs-on: ubuntu-latest + steps: + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.54.0 # MSRV + override: true + - name: Cache Builds + uses: Swatinem/rust-cache@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Default features + run: cargo check --all-targets + - name: All features + Debug + run: cargo check --all-targets --features "wrap_help yaml regex debug" + - name: No features + run: cargo check --all-targets --no-default-features --features "std cargo" + - name: UI Tests + run: cargo test --package clap_derive -- ui diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8f34ba24355..636f0b2f1ff7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,16 +2,13 @@ name: CI on: push: branches: [master, staging, trying] - pull_request: - branches: [master] - types: [opened, reopened, synchronize] concurrency: - group: ci-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + group: ci-${{ github.ref }} cancel-in-progress: true jobs: ci: name: CI - needs: [test, wasm, lint] + needs: [test, wasm] runs-on: ubuntu-latest steps: - name: Done @@ -179,60 +176,3 @@ jobs: with: command: check args: --target ${{ matrix.target }} --features "yaml regex" - lint: - name: Linting - runs-on: ubuntu-latest - steps: - - name: Install rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt, clippy - - name: Checkout - uses: actions/checkout@v2 - - name: Clippy for almost no features - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --no-default-features --features "std cargo" -p clap:3.0.0-beta.4 - - name: Clippy for all features - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --features "wrap_help yaml regex" -- -D warnings - - name: Format check - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check - coverage: - name: Coverage - continue-on-error: true - runs-on: ubuntu-latest - steps: - - name: Install rust - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - components: llvm-tools-preview - override: true - - name: Checkout - uses: actions/checkout@v2 - - name: Install llvm-cov - uses: actions-rs/install@v0.1 - with: - crate: cargo-llvm-cov - version: 0.1.0-alpha.4 - use-tool-cache: true - - name: Coverage - uses: actions-rs/cargo@v1 - with: - command: llvm-cov - args: --features "wrap_help yaml regex" --lcov --output-path lcov.info - - name: Coveralls - uses: coverallsapp/github-action@master - with: - path-to-lcov: lcov.info - github-token: ${{ secrets.github_token }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000000..9ff0966d02e9 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,39 @@ +name: Coverage +on: + pull_request: + branches: [master] + push: + branches: [master, staging, trying] +concurrency: + group: ci-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true +jobs: + coverage: + name: Coverage + continue-on-error: true + runs-on: ubuntu-latest + steps: + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: llvm-tools-preview + override: true + - name: Checkout + uses: actions/checkout@v2 + - name: Install llvm-cov + uses: actions-rs/install@v0.1 + with: + crate: cargo-llvm-cov + version: 0.1.0-alpha.4 + use-tool-cache: true + - name: Coverage + uses: actions-rs/cargo@v1 + with: + command: llvm-cov + args: --features "wrap_help yaml regex" --lcov --output-path lcov.info + - name: Coveralls + uses: coverallsapp/github-action@master + with: + path-to-lcov: lcov.info + github-token: ${{ secrets.github_token }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000000..0b65f0256bd2 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,40 @@ +name: Lint +on: + pull_request: + branches: [master] + push: + branches: [master, staging, trying] +concurrency: + group: ci-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true +jobs: + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + - name: Cache Builds + uses: Swatinem/rust-cache@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Clippy for almost no features + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --no-default-features --features "std cargo" + - name: Clippy for all features + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --features "wrap_help yaml regex" -- -D warnings + - name: Format check + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check diff --git a/bors.toml b/bors.toml index 8491ef8c1b2b..6b67a4b046b7 100644 --- a/bors.toml +++ b/bors.toml @@ -2,7 +2,7 @@ status = [ "CI", ] pr_status = [ - "CI", + "CI-PR, Linting", ] timeout_sec = 7200 prerun_timeout_sec = 7200