Skip to content

change binary build strategy #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
File renamed without changes.
17 changes: 14 additions & 3 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
description: "Machine to run on"
required: true
type: string
target:
description: "Target to build for"
required: true
type: string
env:
CARGO_TERM_COLOR: always
rust_version: 1.83.0
Expand All @@ -37,16 +41,23 @@ jobs:
rustup --version
cargo --version
rustc --version
- name: Add Rust Target
run: |
rustup target add ${{ inputs.target }}
- name: Log default machine target
# for comparison
run: |
rustc -vV | sed -n 's|host: ||p'
- name: Prepare log dir
run: mkdir -p ${{ inputs.log-dir }}
- name: Build
shell: bash
run: cargo build --release --verbose 2>&1 | tee -a ${{ inputs.log-dir }}/build.log
run: cargo build --target=${{ inputs.target }} --release --verbose 2>&1 | tee -a ${{ inputs.log-dir }}/build.log
- name: Test
shell: bash
run: |
set -o pipefail
cargo test --verbose 2>&1 | tee -a ${{ inputs.log-dir }}/test.log
cargo test --target=${{ inputs.target }} --verbose 2>&1 | tee -a ${{ inputs.log-dir }}/test.log
- name: Clippy
shell: bash
if: ${{ success() || failure() }}
Expand All @@ -69,5 +80,5 @@ jobs:
with:
name: ${{ inputs.output_binary_name }}
overwrite: true
path: target/release/${{ inputs.binary_name }}
path: target/${{ inputs.target }}/release/${{ inputs.binary_name }}
if-no-files-found: error
16 changes: 11 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,28 @@ jobs:
build-package:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
include:
- os: ubuntu-latest
binary: dls
output_binary_name: dml-server-x86_64-gnu
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
binary: dls
output_binary_name: dml-server-x86_64-musl
target: x86_64-unknown-linux-musl
- os: windows-latest
binary: dls.exe
output_binary_name: dml-server.exe
target: x86_64-pc-windows-msvc
uses: ./.github/workflows/binaries.yml
with:
binary_name: ${{ matrix.binary }}
output_binary_name: dml-server-${{ matrix.os }}
output_binary_name: ${{ matrix.output_binary_name }}
target: ${{ matrix.target }}
log-dir: ${{ matrix.binary }}-logs
os: ${{ matrix.os }}
check-package:
uses: ./.github/workflows/scans.yml
uses: ./.github/workflows/audit.yml
with:
os: ubuntu-latest
log-dir: checking-logs
Expand Down
Loading