wazabin-pcode 0.1.0

Shared p-code vocabulary, source-shaped AST, operators, and diagnostics
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  # Override this repository variable when wazabin-jstd is hosted elsewhere.
  JSTD_REPOSITORY: ${{ vars.JSTD_REPOSITORY || format('{0}/jstd', github.repository_owner) }}

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Check out wazabin-jstd
        run: |
          git clone --depth=1 "https://github.com/${JSTD_REPOSITORY}.git" \
            "$GITHUB_WORKSPACE/../wazabin-jstd"
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - run: cargo fmt --check
      - run: cargo clippy --all-targets --all-features -- -D warnings
      - run: cargo test --all-features
      - run: cargo doc --no-deps

  coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Check out wazabin-jstd
        run: |
          git clone --depth=1 "https://github.com/${JSTD_REPOSITORY}.git" \
            "$GITHUB_WORKSPACE/../wazabin-jstd"
      - uses: dtolnay/rust-toolchain@stable
      - uses: taiki-e/install-action@cargo-llvm-cov
      - run: cargo llvm-cov --all-features --fail-under-lines 75 --lcov --output-path lcov.info
      - run: cargo llvm-cov report --summary-only
      - uses: actions/upload-artifact@v4
        with:
          name: lcov
          path: lcov.info
          if-no-files-found: error