name: CI
on:
pull_request:
branches: [develop, main]
push:
branches: [develop, main]
schedule:
- cron: '0 6 * * 1'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Add clippy + rustfmt
run: rustup component add clippy rustfmt
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo test --locked
starter:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
runtime: [node, deno, bun, edge]
steps:
- uses: actions/checkout@v5
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- run: cargo build
- name: Install Deno
if: matrix.runtime == 'deno'
run: |
curl -fsSL https://deno.land/install.sh | sh -s -- --yes
echo "$HOME/.deno/bin" >> "$GITHUB_PATH"
- name: Install Bun
if: matrix.runtime == 'bun'
run: |
curl -fsSL https://bun.sh/install | bash
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
- run: scripts/starter-smoke.sh ${{ matrix.runtime }}
core-freshness:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Compare the scaffold pin against the latest dist-tag
run: |
pinned=$(grep -oP 'CORE_VERSION: &str = "\K[^"]+' src/template.rs)
latest=$(npm view @green-tea/core dist-tags.latest)
echo "pinned=$pinned latest=$latest"
if [ "$pinned" != "$latest" ]; then
echo "::error::matcha scaffolds @green-tea/core@$pinned but the latest tag is $latest."
echo "Bump CORE_VERSION in src/template.rs and let the starter job prove it still boots."
exit 1
fi
installer:
runs-on: ${{ matrix.os == 'macos-14' && github.server_url == 'https://github.com' && 'macos-15' || matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
steps:
- uses: actions/checkout@v5
- name: Lint the installer
if: matrix.os == 'ubuntu-latest'
run: |
# GitHub's hosted image ships shellcheck. The act image Gitea's
# `ubuntu-latest` maps to (catthehacker/ubuntu:act-22.04) does not, so
# bare `shellcheck` was a step that passed on one forge and failed on
# the other — the exact forge-dependent break this file's own header
# comment exists to avoid.
if ! command -v shellcheck >/dev/null; then
sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck
fi
shellcheck install.sh test_install.sh
- run: ./test_install.sh