xrcf 0.1.0

A compiler framework to enable the rapid development of programming language compilers
Documentation
name: ci

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

env:
  RUST_TOOLCHAIN: '1.81'

jobs:
  test:
    runs-on: ubuntu-22.04
    timeout-minutes: 30

    steps:
      - uses: actions/checkout@v4

      - uses: Swatinem/rust-cache@v2

      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: '${{ env.RUST_TOOLCHAIN }}'

      # Compile, but don't run.
      - run: cargo test --no-run

      - run: cargo test --all-features

  typos:
    runs-on: ubuntu-22.04
    timeout-minutes: 10

    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: '${{ env.RUST_TOOLCHAIN }}'

      - run: cargo install typos-cli

      - run: typos .

  fmt:
    runs-on: ubuntu-22.04
    timeout-minutes: 10
    if: github.ref != 'refs/heads/main'

    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: '${{ env.RUST_TOOLCHAIN }}'

      # Do not use the default GitHub Action.
      # It took both Forgejo and the runner down (100% CPU).
      - run: rustup component add rustfmt

      - run: cargo fmt --all --check