Skip to content

Move the next branch into master #708

Move the next branch into master

Move the next branch into master #708

Workflow file for this run

name: Rust CLI CI
on:
push:
branches-ignore:
- "master"
- "next"
paths:
- "zowex/**"
- '.github/workflows/rust-cli*.yml'
pull_request:
paths: "zowex/**"
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Prepare Cross
run: cargo install [email protected]
# Need to build in container with old version of GLIBC to support RHEL 7
# https://kobzol.github.io/rust/ci/2021/05/07/building-rust-binaries-in-ci-that-work-with-older-glibc.html
- name: Build
working-directory: zowex
run: cross build --verbose
- name: Create Archive
run: |
cd zowex/target/x86_64-unknown-linux-gnu/debug
tar -cvzf zowe.tgz zowe
- name: Archive Results
id: upload
uses: actions/upload-artifact@v4
with:
name: zowe-linux.tgz
path: zowex/target/x86_64-unknown-linux-gnu/debug/zowe.tgz
- name: Run linter
run: |
cargo clippy --manifest-path=zowex/Cargo.toml
- name: Run tests
run: cargo test unit --verbose --manifest-path=zowex/Cargo.toml -- --nocapture
build-macos:
name: Build MacOS
runs-on: macos-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin
- name: Build
run: |
cargo build --verbose --target aarch64-apple-darwin --manifest-path=zowex/Cargo.toml
cargo build --verbose --target x86_64-apple-darwin --manifest-path=zowex/Cargo.toml
mkdir -p zowex/target/debug && cd zowex/target/debug
mv ../aarch64-apple-darwin/debug/zowe zowe.aarch64 && mv ../x86_64-apple-darwin/debug/zowe zowe.x86_64
lipo -create -output zowe zowe.aarch64 zowe.x86_64
# Use gtar instead of tar on MacOS to prevent extra `GNUSparseFile.0` directory
- name: Create Archive
run: |
cd zowex/target/debug
gtar -cvzf zowe.tgz zowe
- name: Archive Results
id: upload
uses: actions/upload-artifact@v4
with:
name: zowe-macos.tgz
path: zowex/target/debug/zowe.tgz
- name: Run tests
run: cargo test unit --verbose --manifest-path=zowex/Cargo.toml -- --nocapture
build-windows:
name: Build Windows
runs-on: windows-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --verbose --manifest-path=zowex/Cargo.toml
env:
RUSTFLAGS: "-Ctarget-feature=+crt-static"
- name: Create Archive
run: |
cd zowex/target/debug
tar -cvzf zowe.tgz zowe.exe
- name: Archive Results
id: upload
uses: actions/upload-artifact@v4
with:
name: zowe-windows.tgz
path: zowex/target/debug/zowe.tgz
- name: Run tests
run: cargo test unit --verbose --manifest-path=zowex/Cargo.toml -- --nocapture