Skip to content

Commit

Permalink
ci: Make sure to build on multiple platforms (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1sk9 authored Dec 2, 2024
1 parent 06f40f2 commit beab1fe
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
51 changes: 47 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ on:
- main

jobs:
build-babyrite:
check:
runs-on: ubuntu-latest
name: Build babyrite
steps:
- name: Checkout branch
uses: actions/checkout@v4
Expand All @@ -34,6 +33,50 @@ jobs:

- name: Run test
run: cargo test --verbose
build:
name: build (${{ matrix.job.target }})
runs-on: ${{ matrix.job.os || 'ubuntu-latest' }}
needs: check
strategy:
fail-fast: false
matrix:
# Note: babyrite will no longer support Windows
job:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use-cross: false
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
use-cross: true
- os: macos-latest
target: x86_64-apple-darwin
use-cross: false
- os: macos-latest
target: aarch64-apple-darwin
use-cross: false
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.job.target }}

- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "babyrite/gh-actions-cache"

- name: Install cross
if: matrix.job.use-cross
run: cargo install cross

# note: In Ubuntu-latest (Ubuntu 24), musl-tools has disappeared, so it must be installed separately.
- name: Install musl-gcc
if: matrix.job.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get update && sudo apt-get install -y musl-tools

- name: Run Build
run: cargo build --verbose
- name: Build
run: |
cargo build --verbose --target ${{ matrix.job.target }}
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
with:
fetch-depth: 0


- name: Get token
id: babyrite-token
uses: tibdex/github-app-token@v2
Expand Down

0 comments on commit beab1fe

Please sign in to comment.