Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CLI

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
name: Build Rust (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
bin_src: rust/target/release/contentmd
bin_dst: dist/contentmd-linux
artifact: contentmd-linux
- os: macos-latest
bin_src: rust/target/release/contentmd
bin_dst: dist/contentmd-macos
artifact: contentmd-macos
- os: windows-latest
bin_src: rust/target/release/contentmd.exe
bin_dst: dist/contentmd-windows.exe
artifact: contentmd-windows

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust dependencies
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Run Tests
working-directory: rust
run: cargo test

- name: Build Binary
working-directory: rust
run: cargo build --release

- name: Stage binary for upload
shell: bash
run: |
mkdir -p dist
cp ${{ matrix.bin_src }} ${{ matrix.bin_dst }}

- name: Upload binary artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.bin_dst }}
retention-days: 2
1 change: 1 addition & 0 deletions rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading
Loading