mirror of
https://github.com/gorules/zen.git
synced 2026-10-03 16:02:27 +00:00
* chore: improve release process * fix locked build on node.js * fix release naming * fix .node bindings * revert node.yaml * fix * add locked param * fix: node
103 lines
2.6 KiB
YAML
103 lines
2.6 KiB
YAML
name: Rust
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'bindings/**'
|
|
- 'examples/**'
|
|
- '.github/workflows/python.yaml'
|
|
- '.github/workflows/node.yaml'
|
|
push:
|
|
branches:
|
|
- master
|
|
tags-ignore:
|
|
- '**'
|
|
paths-ignore:
|
|
- 'bindings/**'
|
|
- 'examples/**'
|
|
- '.github/workflows/python.yaml'
|
|
- '.github/workflows/node.yaml'
|
|
# Crates.io publish is driven by the GitHub Release that release-please
|
|
# creates for the linked `core` group (anchored on tag `zen-engine-v<version>`).
|
|
release:
|
|
types: [published]
|
|
|
|
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 }})
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-latest
|
|
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 }}
|
|
- run: cargo test --workspace --all-features --exclude zen-ffi --exclude zen-nodejs --exclude zen-python --locked
|
|
- name: Test without arbitrary_precision
|
|
run: cargo test --workspace --exclude zen-ffi --exclude zen-nodejs --exclude zen-python --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
|
|
# Publishes only on the release-please GitHub Release for the core group.
|
|
if: "github.event_name == 'release' && startsWith(github.event.release.tag_name, 'zen-engine-v')"
|
|
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
|