pichu 0.4.0

The static site generator designed to evolve with your needs.
Documentation
name: CI

on:
  pull_request:
    branches:
      - main
  push:
    tags:
      - "v*"
    branches:
      - main

jobs:
  rustfmt_check:
    name: Rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
      - run: cargo fmt -- --check
  clippy_check:
    name: Clippy check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: cargo-all-
      - run: cargo check
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: cargo-all-
      - run: cargo test
  publish_on_crates_io:
    name: Publish on crates.io
    runs-on: ubuntu-latest
    if: startsWith(github.ref, 'refs/tags') # Only on tags
    needs:
      - rustfmt_check
      - clippy_check
      - test
    steps:
      - uses: actions/checkout@v4
      - run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}