Skip to content
Merged
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
78 changes: 78 additions & 0 deletions .github/workflows/cube-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Cube CLI CI

on:
push:
branches: [master]
paths:
- 'rust/cube-cli/**'
- '.github/workflows/cube-cli.yml'
pull_request:
paths:
- 'rust/cube-cli/**'
- '.github/workflows/cube-cli.yml'

concurrency:
group: cube-cli-ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: rust/cube-cli
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
cache-workspaces: rust/cube-cli
- name: Check formatting
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings

build-and-test:
name: Build & test ${{ matrix.target }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
# Same targets the release builds in publish.yml, so a broken
# cross-platform build is caught in the PR rather than at release.
# Linux — fully static single binaries (musl + rustls, no OpenSSL).
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
# macOS — Intel and Apple Silicon.
- os: macos-15-intel
target: x86_64-apple-darwin
- os: macos-14
target: aarch64-apple-darwin
# Windows.
- os: windows-2022
target: x86_64-pc-windows-msvc
defaults:
run:
working-directory: rust/cube-cli
steps:
- uses: actions/checkout@v4
- name: Install musl tools
if: endsWith(matrix.target, '-musl')
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
cache-workspaces: rust/cube-cli
- name: Test
run: cargo test --locked --target ${{ matrix.target }}
- name: Build (release)
run: cargo build --release --locked --target ${{ matrix.target }}
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,65 @@ jobs:
tag: ${{ github.ref }}
overwrite: true

cube-cli:
name: Cube CLI ${{ matrix.target }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
# Linux — fully static single binaries (musl + rustls, no OpenSSL).
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
# macOS — Intel and Apple Silicon.
- os: macos-15-intel
target: x86_64-apple-darwin
- os: macos-14
target: aarch64-apple-darwin
# Windows.
- os: windows-2022
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- name: Install musl tools
if: endsWith(matrix.target, '-musl')
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
cache-workspaces: rust/cube-cli
- name: Set crate version to the release version
shell: bash
run: |
v="${GITHUB_REF_NAME#v}"
sed -i.bak "s/^version = .*/version = \"$v\"/" rust/cube-cli/Cargo.toml
rm -f rust/cube-cli/Cargo.toml.bak
- name: Build
working-directory: rust/cube-cli
run: cargo build --release --target ${{ matrix.target }}
- name: Create archive
shell: bash
run: |
set -euo pipefail
bindir="rust/cube-cli/target/${{ matrix.target }}/release"
bin=cube
[ "${{ runner.os }}" = "Windows" ] && bin=cube.exe
tar -C "$bindir" -czf "cube-${{ matrix.target }}.tar.gz" "$bin"
- name: Upload Binary to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: cube-${{ matrix.target }}.tar.gz
asset_name: cube-${{ matrix.target }}.tar.gz
tag: ${{ github.ref }}
overwrite: true

trigger-test-suites:
name: Trigger test suites run
runs-on: ubuntu-24.04
Expand Down
1 change: 1 addition & 0 deletions rust/cube-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading
Loading