Skip to content

Commit

Permalink
Merge pull request #2802 from epage/ci
Browse files Browse the repository at this point in the history
Speed up PR feedback
  • Loading branch information
epage authored Oct 7, 2021
2 parents 8eb4377 + 63275d3 commit 00f7fe5
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 113 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/benchmark.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI-PR
on:
pull_request:
branches: [master]
concurrency:
group: ci-pr-${{ github.ref }}
cancel-in-progress: true
jobs:
ci-pr:
name: CI-PR
needs: [test-minimal, test-full, msrv]
runs-on: ubuntu-latest
steps:
- name: Done
run: exit 0
test-minimal:
name: Tests (Minimal)
env:
FLAGS: --no-default-features --features 'std cargo'
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: Compile
run: cargo test --no-run ${{ env.FLAGS }}
- name: Test
run: cargo test ${{ env.FLAGS }}
test-full:
name: Tests (Full)
env:
FLAGS: --features 'wrap_help yaml regex'
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: Compile
run: cargo test --no-run ${{ env.FLAGS }}
- name: Test
run: cargo test ${{ env.FLAGS }}
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
65 changes: 1 addition & 64 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ 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 }}
cancel-in-progress: true
jobs:
ci:
name: CI
needs: [test, wasm, lint]
needs: [test, wasm]
runs-on: ubuntu-latest
steps:
- name: Done
Expand Down Expand Up @@ -179,60 +173,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/[email protected]
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 }}
39 changes: 39 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Coverage
on:
pull_request:
branches: [master]
push:
branches: [master, staging, trying]
concurrency:
group: coverage-${{ 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/[email protected]
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 }}
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint
on:
pull_request:
branches: [master]
push:
branches: [master, staging, trying]
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
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
2 changes: 0 additions & 2 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on:
push:
branches: [master]
paths: ["site/**"]
concurrency:
group: site
jobs:
site:
name: Deploy site
Expand Down
2 changes: 1 addition & 1 deletion bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ status = [
"CI",
]
pr_status = [
"CI",
"CI-PR", "Lint",
]
timeout_sec = 7200
prerun_timeout_sec = 7200
Expand Down

0 comments on commit 00f7fe5

Please sign in to comment.