Files
zen/.github/workflows/rust.yaml
stefan-gorules 3a25f4f5c3 feat: engine version (#574)
* feat(engine): select the engine with a version option

* ci: run the two feature sets as parallel jobs

* refactor(engine): drop the global compiled switch

* feat(engine): pin the clock through options instead of the environment

The __ZEN_MOCK_UTC_TIME variable and the ZEN_EXPRESSION_CONFIG lane flag are
gone. Isolate takes with_now and with_lane, and the interpreted engine now
honours the now option in expressions, so tests pass the instant explicitly.

* test(engine): count trace paths per thread and drop the trace test lock

* ci: run tests with nextest

* test(engine): share golden trace outcomes between variants
2026-11-21 20:09:14 +01:00

102 lines
2.6 KiB
YAML

name: Rust
permissions:
contents: read
id-token: write
on:
pull_request:
paths-ignore:
- 'bindings/**'
- 'examples/**'
- '.github/workflows/python.yaml'
- '.github/workflows/node.yaml'
push:
tags:
- 'zen-engine-v*'
env:
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: cargo test (${{ matrix.os }}, ${{ matrix.features.name }})
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
features:
- name: all features
key: all
flags: --all-features
- name: default features
key: default
flags: ''
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- uses: ./.github/actions/setup-rust
with:
shared-key: rust-test-${{ matrix.os }}-${{ matrix.features.key }}
sccache-bucket: ${{ secrets.SCCACHE_S3_BUCKET }}
sccache-region: ${{ secrets.SCCACHE_AWS_REGION }}
sccache-role-arn: ${{ secrets.SCCACHE_AWS_ROLE_ARN }}
- uses: taiki-e/install-action@nextest
- run: cargo nextest run --workspace ${{ matrix.features.flags }} --exclude zen-ffi --exclude zen-nodejs --exclude zen-python --locked --no-fail-fast
- run: cargo test --doc --workspace ${{ matrix.features.flags }} --exclude zen-ffi --exclude zen-nodejs --exclude zen-python --exclude zen-engine --locked
fmt:
name: Cargo FMT
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- run: cargo fmt --all -- --check
release:
name: Cargo Release
runs-on: ubuntu-latest
environment: release
if: "github.ref_type == 'tag'"
needs:
- test
- fmt
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- name: Login to Crates.IO
run: cargo login ${{ secrets.CRATES_TOKEN }}
- name: Publish Macros
run: cd core/macros && cargo publish --locked
- name: Publish Types
run: cd core/types && cargo publish --locked
- name: Publish Expression
run: cd core/expression && cargo publish --locked
- name: Publish Template
run: cd core/template && cargo publish --locked
- name: Publish Engine
run: cd core/engine && cargo publish --locked