void/.github/workflows/build-cli-matrix.yml

59 lines
1.2 KiB
YAML

name: Build CLI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build-cli:
name: Build CLI (macOS)
runs-on: macos-12
timeout-minutes: 60
defaults:
run:
working-directory: cli
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check clean git state
run: .github/workflows/check-clean-git-state.sh
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Cache Cargo dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
cli/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build CLI
run: |
cargo build --release
- name: Run CLI tests
run: |
cargo test
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: code-cli-macos
path: cli/target/release/code