2023-12-07 21:24:40 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-12-07 22:52:36 +01:00
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'feat/*'
|
2023-12-07 21:24:40 +01:00
|
|
|
pull_request:
|
2023-12-07 22:52:36 +01:00
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'feat/*'
|
2023-12-07 21:24:40 +01:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2024-01-28 12:18:14 +01:00
|
|
|
{%- if ci-tests %}
|
2023-12-07 21:24:40 +01:00
|
|
|
test:
|
|
|
|
name: Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
|
|
- name: Run cargo test
|
|
|
|
run: cargo test
|
2024-01-28 12:18:14 +01:00
|
|
|
{%- endif %}
|
|
|
|
{% if ci-clippy %}
|
2023-12-07 21:24:40 +01:00
|
|
|
clippy_check:
|
|
|
|
name: Clippy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
|
|
with:
|
|
|
|
components: clippy
|
|
|
|
- name: Run clippy
|
|
|
|
run: cargo clippy -- -D warnings
|
2024-01-28 12:18:14 +01:00
|
|
|
{%- endif %}
|
|
|
|
{% if ci-fmt %}
|
2023-12-07 21:24:40 +01:00
|
|
|
format:
|
|
|
|
name: Format
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install toolchain
|
|
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
|
|
with:
|
|
|
|
components: rustfmt
|
|
|
|
- name: Run cargo fmt
|
|
|
|
run: cargo fmt --all -- --check
|
2024-01-28 12:16:03 +01:00
|
|
|
{%- endif -%}
|