mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
82 lines
2.2 KiB
YAML
82 lines
2.2 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
toolchain: x86_64-unknown-linux-musl
|
|
platform: linux
|
|
ext:
|
|
- os: windows-latest
|
|
toolchain: x86_64-pc-windows-gnu
|
|
platform: windows
|
|
ext: .exe
|
|
- os: macos-latest
|
|
toolchain: x86_64-apple-darwin
|
|
platform: darwin
|
|
ext:
|
|
- os: macos-latest
|
|
toolchain: aarch64-apple-darwin
|
|
platform: m1darwin
|
|
ext:
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Cargo cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Install system dependencies
|
|
if: matrix.platform == 'linux'
|
|
run: sudo apt-get install musl-tools
|
|
|
|
- name: Install toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
target: ${{ matrix.toolchain }}
|
|
|
|
- name: Test
|
|
run: cargo test --release --all-features --target ${{ matrix.toolchain }}
|
|
|
|
- name: Build
|
|
run: cargo build --release --all-features --target ${{ matrix.toolchain }}
|
|
|
|
- name: Upload binary artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: crunchy-cli_${{ matrix.platform }}
|
|
path: ./target/${{ matrix.toolchain }}/release/crunchy-cli${{ matrix.ext }}
|
|
if-no-files-found: error
|
|
|
|
- name: Upload manpages artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: manpages
|
|
path: ./target/${{ matrix.toolchain }}/release/manpages
|
|
if-no-files-found: error
|
|
|
|
- name: Upload completions artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: completions
|
|
path: ./target/${{ matrix.toolchain }}/release/completions
|
|
if-no-files-found: error
|