diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..0456cfa --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,17 @@ +name: Rust Check + +on: + pull_request: + push: + branches: + - main + +jobs: + cargo-check: + name: cargo check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo check diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index c677f2e..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: CI - -on: - pull_request: - push: - branches: - - main - -jobs: - cargo-fmt: - name: cargo fmt --check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - - uses: Swatinem/rust-cache@v2 - - run: cargo fmt --check - - cargo-clippy: - name: cargo clippy -- -D warnings - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - - uses: Swatinem/rust-cache@v2 - - run: cargo clippy --all-targets -- -D warnings - - cargo-check: - name: cargo check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: cargo check - - cargo-test: - name: cargo test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: cargo test - - cross-platform: - name: cross-platform default (${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - run: cargo check - - run: cargo test diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 0000000..a9f5618 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,19 @@ +name: Rust Clippy + +on: + pull_request: + push: + branches: + - main + +jobs: + cargo-clippy: + name: cargo clippy --all-targets -- -D warnings + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy --all-targets -- -D warnings diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..cec9979 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,27 @@ +name: Coverage + +on: + pull_request: + push: + branches: + - main + +jobs: + coverage: + name: cargo llvm-cov + codecov + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@cargo-llvm-cov + - run: cargo llvm-cov --workspace --all-targets --lcov --output-path lcov.info + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info + fail_ci_if_error: true diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml new file mode 100644 index 0000000..ff5bc53 --- /dev/null +++ b/.github/workflows/cross-platform.yml @@ -0,0 +1,24 @@ +name: Cross Platform + +on: + pull_request: + push: + branches: + - main + +jobs: + cross-platform: + name: cross-platform default (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo check + - run: cargo test diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 0000000..48a4eb4 --- /dev/null +++ b/.github/workflows/fmt.yml @@ -0,0 +1,19 @@ +name: Rust Format + +on: + pull_request: + push: + branches: + - main + +jobs: + cargo-fmt: + name: cargo fmt --check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - uses: Swatinem/rust-cache@v2 + - run: cargo fmt --check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b2aad5f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,17 @@ +name: Rust Test + +on: + pull_request: + push: + branches: + - main + +jobs: + cargo-test: + name: cargo test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo test