|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master, dev] |
| 6 | + pull_request: |
| 7 | + branches: [master, dev] |
| 8 | + |
| 9 | +env: |
| 10 | + CARGO_TERM_COLOR: always |
| 11 | + RUST_BACKTRACE: 1 |
| 12 | + |
| 13 | +jobs: |
| 14 | + rust-check: |
| 15 | + name: Rust Check |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout repository |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Install Rust toolchain |
| 22 | + uses: dtolnay/rust-toolchain@nightly |
| 23 | + with: |
| 24 | + components: rustfmt, clippy |
| 25 | + |
| 26 | + - name: Cache cargo registry |
| 27 | + uses: actions/cache@v4 |
| 28 | + with: |
| 29 | + path: | |
| 30 | + ~/.cargo/registry |
| 31 | + ~/.cargo/git |
| 32 | + target |
| 33 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 34 | + restore-keys: | |
| 35 | + ${{ runner.os }}-cargo- |
| 36 | +
|
| 37 | + - name: Check formatting |
| 38 | + run: cargo fmt --all -- --check |
| 39 | + |
| 40 | + - name: Run clippy |
| 41 | + run: cargo clippy --all-targets --all-features -- -D warnings |
| 42 | + |
| 43 | + - name: Check compilation |
| 44 | + run: cargo check --all-targets --all-features |
| 45 | + |
| 46 | + rust-test: |
| 47 | + name: Rust Test |
| 48 | + strategy: |
| 49 | + fail-fast: false |
| 50 | + matrix: |
| 51 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 52 | + runs-on: ${{ matrix.os }} |
| 53 | + steps: |
| 54 | + - name: Checkout repository |
| 55 | + uses: actions/checkout@v4 |
| 56 | + |
| 57 | + - name: Install Rust toolchain |
| 58 | + uses: dtolnay/rust-toolchain@nightly |
| 59 | + |
| 60 | + - name: Cache cargo registry |
| 61 | + uses: actions/cache@v4 |
| 62 | + with: |
| 63 | + path: | |
| 64 | + ~/.cargo/registry |
| 65 | + ~/.cargo/git |
| 66 | + target |
| 67 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 68 | + restore-keys: | |
| 69 | + ${{ runner.os }}-cargo- |
| 70 | +
|
| 71 | + - name: Run tests (default features) |
| 72 | + run: cargo test --workspace |
| 73 | + |
| 74 | + js-check: |
| 75 | + name: JavaScript/TypeScript Check |
| 76 | + runs-on: ubuntu-latest |
| 77 | + steps: |
| 78 | + - name: Checkout repository |
| 79 | + uses: actions/checkout@v4 |
| 80 | + |
| 81 | + - name: Setup Node.js |
| 82 | + uses: actions/setup-node@v4 |
| 83 | + with: |
| 84 | + node-version: "20" |
| 85 | + |
| 86 | + - name: Install pnpm |
| 87 | + uses: pnpm/action-setup@v4 |
| 88 | + with: |
| 89 | + version: 9 |
| 90 | + |
| 91 | + - name: Get pnpm store directory |
| 92 | + shell: bash |
| 93 | + run: | |
| 94 | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT |
| 95 | + id: pnpm-cache |
| 96 | + |
| 97 | + - name: Setup pnpm cache |
| 98 | + uses: actions/cache@v4 |
| 99 | + with: |
| 100 | + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} |
| 101 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 102 | + restore-keys: | |
| 103 | + ${{ runner.os }}-pnpm-store- |
| 104 | +
|
| 105 | + - name: Install dependencies |
| 106 | + run: pnpm install --frozen-lockfile |
| 107 | + |
| 108 | + - name: Run Biome CI (format + lint) |
| 109 | + run: npx biome ci . |
| 110 | + |
| 111 | + - name: Run TypeScript type check |
| 112 | + run: pnpm run typecheck:frontend |
| 113 | + |
| 114 | + - name: Build frontend packages |
| 115 | + run: pnpm run build:frontend |
| 116 | + |
| 117 | + hugo-consistency-test: |
| 118 | + name: Hugo Consistency Test |
| 119 | + runs-on: ubuntu-latest |
| 120 | + steps: |
| 121 | + - name: Checkout repository |
| 122 | + uses: actions/checkout@v4 |
| 123 | + with: |
| 124 | + submodules: true |
| 125 | + |
| 126 | + - name: Install Rust toolchain |
| 127 | + uses: dtolnay/rust-toolchain@nightly |
| 128 | + |
| 129 | + - name: Cache cargo registry |
| 130 | + uses: actions/cache@v4 |
| 131 | + with: |
| 132 | + path: | |
| 133 | + ~/.cargo/registry |
| 134 | + ~/.cargo/git |
| 135 | + target |
| 136 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 137 | + restore-keys: | |
| 138 | + ${{ runner.os }}-cargo- |
| 139 | +
|
| 140 | + - name: Build rusty-ssg hugo |
| 141 | + run: cargo build --package hugo |
| 142 | + |
| 143 | + - name: Setup Node.js |
| 144 | + uses: actions/setup-node@v4 |
| 145 | + with: |
| 146 | + node-version: "20" |
| 147 | + |
| 148 | + - name: Install pnpm |
| 149 | + uses: pnpm/action-setup@v4 |
| 150 | + with: |
| 151 | + version: 9 |
| 152 | + |
| 153 | + - name: Get pnpm store directory |
| 154 | + shell: bash |
| 155 | + run: | |
| 156 | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT |
| 157 | + id: pnpm-cache |
| 158 | + |
| 159 | + - name: Setup pnpm cache |
| 160 | + uses: actions/cache@v4 |
| 161 | + with: |
| 162 | + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} |
| 163 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 164 | + restore-keys: | |
| 165 | + ${{ runner.os }}-pnpm-store- |
| 166 | +
|
| 167 | + - name: Install dependencies |
| 168 | + run: pnpm install --frozen-lockfile |
| 169 | + |
| 170 | + - name: Run Hugo consistency test for hugo-ananke |
| 171 | + run: | |
| 172 | + cd examples/hugo-ananke |
| 173 | + pnpm test |
| 174 | +
|
| 175 | + - name: Run Hugo consistency test for hugo-blowfish |
| 176 | + run: | |
| 177 | + cd examples/hugo-blowfish |
| 178 | + pnpm test |
| 179 | +
|
| 180 | + - name: Run Hugo consistency test for hugo-mvp |
| 181 | + run: | |
| 182 | + cd examples/hugo-mvp |
| 183 | + pnpm test |
0 commit comments