Skip to content

Commit

Permalink
Simultaneous builds for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
pshenmic committed Oct 17, 2024
1 parent d9e2872 commit 42cfb7b
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
- master

jobs:
build_linux:
build_linux_x86_64:
name: Build Linux
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get install -y build-essential pkg-config libssl-dev clang cmake llvm g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libc6-dev-i386 g++-13-multilib gcc-13-multilib && dpkg -l
run: sudo apt-get install -y build-essential pkg-config libssl-dev clang cmake llvm

- name: Install protoc
id: deps-protoc
Expand All @@ -28,26 +28,54 @@ jobs:
export PATH="${PATH}:${HOME}/.local/bin"
- name: Add Rust targets
run: rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
run: rustup target add x86_64-unknown-linux-gnu

- name: Create Cargo multiarch config
run: |
touch ~/.cargo/config.toml
echo "
[target.x86_64-unknown-linux-gnu]
linker = \"x86_64-linux-gnu-gcc\"
[target.aarch64-unknown-linux-gnu]
linker = \"aarch64-linux-gnu-gcc\"
" > ~/.cargo/config.toml
- name: Build for Linux x86
run: cargo build -r --target=x86_64-unknown-linux-gnu --verbose && mv target/x86_64-unknown-linux-gnu/release/platform-cli ./platform-cli-gnu-x86_64

build_linux_arm64:
name: Build Linux
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get install -y build-essential pkg-config libssl-dev clang cmake llvm g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libc6-dev-i386 g++-13-multilib gcc-13-multilib && dpkg -l

- name: Install protoc
id: deps-protoc
shell: bash
run: |
curl -Lo /tmp/protoc.zip \
"https://github.com/protocolbuffers/protobuf/releases/download/v27.3/protoc-27.3-linux-aarch64.zip"
unzip -o /tmp/protoc.zip -d ${HOME}/.local
echo "PROTOC=${HOME}/.local/bin/protoc" >> $GITHUB_ENV
export PATH="${PATH}:${HOME}/.local/bin"
- name: Add Rust targets
run: rustup target add aarch64-unknown-linux-gnu

- name: Create Cargo multiarch config
run: |
touch ~/.cargo/config.toml
echo "
[target.aarch64-unknown-linux-gnu]
linker = \"aarch64-linux-gnu-gcc\"
" > ~/.cargo/config.toml
- name: Build for Linux arm64
run: cargo build -r --target=aarch64-unknown-linux-gnu --verbose && mv target/unknown-linux-gnu/release/platform-cli ./platform-cli-gnu-arm64

build_max_x86_64:
build_mac_x86_64:
name: Build Apple (x86_64)
runs-on: macos-13
timeout-minutes: 30
Expand All @@ -63,7 +91,7 @@ jobs:
- name: Build for Apple x86
run: cargo build -r --target=x86_64-apple-darwin --verbose && mv target/x86_64-apple-darwin/release/platform-cli ./platform-cli_darwin-x86_64

build_max_arm64:
build_mac_arm64:
name: Build Apple (arm64)
runs-on: macos-15
timeout-minutes: 30
Expand Down

0 comments on commit 42cfb7b

Please sign in to comment.