From b010cf41811fe4af615d6fb73b2e1c36b39626cb Mon Sep 17 00:00:00 2001 From: Sh3Rm4n Date: Sat, 21 Aug 2021 20:25:58 +0200 Subject: [PATCH] Split github ci into muliple parts This allows to filter jobs on type of file changes. --- .github/workflows/codegen.yml | 22 +++++++++++ .github/workflows/{ci.yml => hal.yml} | 55 +++++++-------------------- .github/workflows/link-checker.yml | 22 +++++++++++ .github/workflows/markdown.yaml | 20 ++++++++++ .github/workflows/rust.yml | 25 ++++++++++++ .github/workflows/testsuite.yml | 25 ++++++++++++ 6 files changed, 128 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/codegen.yml rename .github/workflows/{ci.yml => hal.yml} (80%) create mode 100644 .github/workflows/link-checker.yml create mode 100644 .github/workflows/markdown.yaml create mode 100644 .github/workflows/rust.yml create mode 100644 .github/workflows/testsuite.yml diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml new file mode 100644 index 000000000..e858a5a22 --- /dev/null +++ b/.github/workflows/codegen.yml @@ -0,0 +1,22 @@ +name: Codegen CI + +on: + push: + branches: [master] + pull_request: + paths: + - 'codegen/**' + +jobs: + codegen: + name: Check Codegen + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + profile: minimal + components: rustfmt + - run: cargo check --target "x86_64-unknown-linux-gnu" -p codegen diff --git a/.github/workflows/ci.yml b/.github/workflows/hal.yml similarity index 80% rename from .github/workflows/ci.yml rename to .github/workflows/hal.yml index 1436a0ed6..ee3c1d4b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/hal.yml @@ -1,9 +1,16 @@ -name: CI +name: HAL CI on: push: branches: [master] pull_request: + paths: + - 'Cargo.toml' + - '.clippy.toml' + - 'build.rs' + - 'src/**' + - 'examples/**' + - '**.toml' jobs: check: @@ -155,53 +162,19 @@ jobs: --features=stm32f303xc --lib --examples -- -D warnings - rustfmt: - name: Rustfmt + # This is only needed, becuase workflows can not trigger other workflows + build-testsuite: + name: Build Testsuite runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable + target: thumbv7em-none-eabihf override: true profile: minimal - components: rustfmt - uses: actions-rs/cargo@v1 with: - command: fmt - args: --all -- --check - - codegen: - name: Check Codegen - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - profile: minimal - components: rustfmt - - run: cargo check --target "x86_64-unknown-linux-gnu" -p codegen - - markdown-lint: - name: Markdown Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: nosborn/github-action-markdown-cli@v2.0.0 - with: - files: . - config_file: .markdownlint.yml - ignore_files: target/ - - link-checker: - name: Link Checker - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Check URLs in documentation - uses: lycheeverse/lychee-action@v1.0.8 - with: - args: --verbose --no-progress "**/*.md" "**/*.rs" "Cargo.toml" "**/Cargo.toml" -h accept=text/html + command: test + args: -p testsuite --no-run diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml new file mode 100644 index 000000000..0f9415157 --- /dev/null +++ b/.github/workflows/link-checker.yml @@ -0,0 +1,22 @@ +name: Link Checker CI + +on: + push: + branches: [master] + pull_request: + paths: + - '**.md' + - '**.rs' + - '**.toml' + +jobs: + link-checker: + name: Link Checker + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Check URLs in documentation + uses: lycheeverse/lychee-action@v1.0.8 + with: + args: --verbose --no-progress "**/*.md" "**/*.rs" "Cargo.toml" "**/Cargo.toml" -h accept=text/html diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml new file mode 100644 index 000000000..12b27c833 --- /dev/null +++ b/.github/workflows/markdown.yaml @@ -0,0 +1,20 @@ +name: Markdown CI + +on: + push: + branches: [master] + pull_request: + paths: + - '**.md' + +jobs: + markdown-lint: + name: Markdown Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: nosborn/github-action-markdown-cli@v2.0.0 + with: + files: . + config_file: .markdownlint.yml + ignore_files: target/ diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 000000000..cda2c5950 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,25 @@ +name: Rust CI + +on: + push: + branches: [master] + pull_request: + paths: + - '**.rs' + +jobs: + rustfmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + profile: minimal + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml new file mode 100644 index 000000000..68bfd1061 --- /dev/null +++ b/.github/workflows/testsuite.yml @@ -0,0 +1,25 @@ +name: Testsuite CI + +on: + push: + branches: [master] + pull_request: + paths: + - 'testsuite/' + +jobs: + build-testsuite: + name: Build Testsuite + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: thumbv7em-none-eabihf + override: true + profile: minimal + - uses: actions-rs/cargo@v1 + with: + command: test + args: -p testsuite --no-run