ci: Split CI in smaller tasks

This commit is contained in:
Kévin Commaille
2022-03-21 09:49:57 +01:00
committed by GitHub
parent eef68d7d4b
commit 806606c675
5 changed files with 389 additions and 85 deletions

View File

@@ -10,8 +10,8 @@ on:
branches: [main, next]
jobs:
check_msrv:
name: Check
all_features:
name: Check All Features
runs-on: ubuntu-latest
steps:
- name: Checkout repo
@@ -38,4 +38,64 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci msrv
args: -p xtask --no-default-features ci msrv-all
client:
name: Check Client
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust 1.55 toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: '1.55'
# Used to compile xtask
- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
with:
# A stable compiler update should automatically not reuse old caches.
# Add the MSRV as a stable cache key too so bumping it also gets us a
# fresh cache.
sharedKey: msrv1.55
- name: Run checks
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci msrv-client
ruma:
name: Check Ruma
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust 1.55 toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: '1.55'
# Used to compile xtask
- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
with:
# A stable compiler update should automatically not reuse old caches.
# Add the MSRV as a stable cache key too so bumping it also gets us a
# fresh cache.
sharedKey: msrv1.55
- name: Run checks
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci msrv-ruma

View File

@@ -10,8 +10,8 @@ on:
branches: [main, next]
jobs:
check_nightly:
name: Check
fmt:
name: Fmt
runs-on: ubuntu-latest
steps:
- name: Checkout repo
@@ -22,23 +22,71 @@ jobs:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Install cargo-sort
uses: actions-rs/install@v0.1
with:
crate: cargo-sort
- name: Run checks
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci nightly
typos:
name: Spell Check with Typos
args: -p xtask --no-default-features ci fmt
check_full:
name: Check Full Features
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Check the spelling of the files in our repo
uses: crate-ci/typos@master
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
- name: Run checks
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci nightly-full
clippy_default:
name: Clippy Default Features
runs-on: ubuntu-latest
needs: check_full
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy
- uses: Swatinem/rust-cache@v1
- name: Run lints
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci clippy-default
clippy_all:
name: Clippy All Features
runs-on: ubuntu-latest
needs: check_full
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy
- uses: Swatinem/rust-cache@v1
- name: Run lints
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci clippy-all

View File

@@ -10,8 +10,8 @@ on:
branches: [main, next]
jobs:
check_stable:
name: Check
check_all:
name: Check All Features
runs-on: ubuntu-latest
steps:
- name: Checkout repo
@@ -27,4 +27,102 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci stable
args: -p xtask --no-default-features ci stable-all
check_client:
name: Check Client
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Run checks
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci stable-client
check_common:
name: Check Common
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Run checks
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci stable-common
test_all:
name: Run Tests
runs-on: ubuntu-latest
needs: check_all
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci test-all
test_doc:
name: Run Doc Tests
runs-on: ubuntu-latest
needs: check_all
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci test-doc
test_common:
name: Test Common Features
runs-on: ubuntu-latest
needs: check_common
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci test-common

30
.github/workflows/style.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Style
env:
CARGO_TERM_COLOR: always
on:
push:
branches: [main, next]
pull_request:
branches: [main, next]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- name: Check spelling
uses: crate-ci/typos@master
- name: Install cargo-sort
uses: actions-rs/install@v0.1
with:
crate: cargo-sort
- name: Run lints
uses: actions-rs/cargo@v1
with:
command: run
args: -p xtask --no-default-features ci lint