Skip to content

Commit

Permalink
cp
Browse files Browse the repository at this point in the history
  • Loading branch information
flxoacn committed Mar 28, 2024
1 parent 5a1ac69 commit 5249a59
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: ci
on:
pull_request:
push:
branches:
- main
# branches:
# - main
workflow_dispatch:
jobs:
get-msrv:
Expand Down Expand Up @@ -47,13 +47,20 @@ jobs:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy

- name: Install Cross on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: cargo install --git https://github.com/cross-rs/cross.git --rev 085092c cross

- name: Check formatting
run: cargo fmt --all -- --check

- name: Build
id: build
run: cargo build --verbose

- name: Build target aarch64-linux-android
if: matrix.os == 'ubuntu-latest'
run: cross build --target aarch64-linux-android --verbose

# This is useful for debugging problems when the expected build artifacts
# (like shell completions and man pages) aren't generated.
- name: Show build.rs stderr
Expand Down Expand Up @@ -103,6 +110,13 @@ jobs:
name: ${{ matrix.os }}-${{ matrix.rust }}-failed_snapshots
path: '**/*.snap.new'

- name: Upload android binary
if: ${{ matrix.os == 'ubuntu-latest' && ( success() || steps.build.outcome == 'success' ) }}
uses: actions/upload-artifact@v3
with:
name: aarch64-linux-android-${{ matrix.rust }}
path: target/aarch64-linux-android/debug/bandwhich

- name: Upload unix binary
if: ${{ matrix.os != 'windows-latest' && ( success() || steps.build.outcome == 'success' ) }}
uses: actions/upload-artifact@v3
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ jobs:
strategy:
matrix:
build:
- aarch64-linux-android
- linux-x64-gnu
- linux-x64-musl
- macos-x64
- windows-x64-msvc
include:
- build: aarch64-linux-android
os: ubuntu-latest
target: aarch64-linux-android
- build: linux-x64-gnu
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
Expand Down Expand Up @@ -84,13 +88,18 @@ jobs:
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get install -y --no-install-recommends musl-tools

- name: Install cross
if: matrix.target == 'aarch64-linux-android'
run: cargo install --git https://github.com/cross-rs/cross.git --rev 085092c cross

- name: Build release binary
shell: bash
env:
CARGO: ${{ (matrix.target == 'aarch64-linux-android') && 'cross' || 'cargo' }}
RUSTFLAGS: "-C strip=symbols"
run: |
mkdir -p "$BANDWHICH_GEN_DIR"
cargo build --verbose --release --target ${{ matrix.target }}
$CARGO build --verbose --release --target ${{ matrix.target }}
- name: Collect build artifacts
shell: bash
Expand Down

0 comments on commit 5249a59

Please sign in to comment.