2024-02-20 04:01:50 +11:00
|
|
|
name: build librashader-capi
|
2023-01-16 07:13:32 +11:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "master" ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "master" ]
|
2023-01-16 07:23:19 +11:00
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * 6"
|
2023-01-16 07:13:32 +11:00
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-02-12 10:30:28 +11:00
|
|
|
profile: ['debug', 'release', 'optimized']
|
2024-02-20 04:01:50 +11:00
|
|
|
os: ['windows-latest', 'ubuntu-latest', 'macos-latest', 'macos-14']
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
output: x86_64-ubuntu
|
|
|
|
- os: windows-latest
|
|
|
|
output: x86_64-windows
|
|
|
|
- os: macos-latest
|
|
|
|
output: x86_64-macos
|
|
|
|
- os: macos-14
|
|
|
|
output: aarch64-macos
|
2023-01-17 12:24:13 +11:00
|
|
|
fail-fast: false
|
2023-01-16 07:13:32 +11:00
|
|
|
runs-on: ${{ matrix.os }}
|
2024-02-20 04:01:50 +11:00
|
|
|
name: ${{ matrix.output }} (${{ matrix.profile }})
|
2023-01-16 07:13:32 +11:00
|
|
|
steps:
|
2023-01-16 17:06:15 +11:00
|
|
|
- name: Checkout repository
|
2024-02-23 16:34:19 +11:00
|
|
|
uses: actions/checkout@v4
|
2023-01-16 17:06:15 +11:00
|
|
|
- name: Install nightly Rust
|
2024-02-21 17:05:59 +11:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
2023-01-16 07:23:19 +11:00
|
|
|
with:
|
|
|
|
toolchain: nightly
|
2023-01-16 07:13:32 +11:00
|
|
|
- name: Build dynamic library
|
2023-02-12 10:05:50 +11:00
|
|
|
run: cargo run -p librashader-build-script -- --profile ${{ matrix.profile }}
|
2023-01-16 07:23:19 +11:00
|
|
|
- name: Upload build artifacts
|
2023-01-16 07:13:32 +11:00
|
|
|
uses: actions/upload-artifact@v3.1.2
|
|
|
|
with:
|
2024-02-20 04:01:50 +11:00
|
|
|
name: ${{ format('librashader-{0}-{1}-{2}', matrix.output, github.sha, matrix.profile) }}
|
2023-02-12 10:37:35 +11:00
|
|
|
path: ${{ format('target/{0}/librashader.*', matrix.profile) }}
|
2024-02-20 04:01:50 +11:00
|
|
|
build-ubuntu-arm64:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
profile: ['debug', 'release', 'optimized']
|
|
|
|
fail-fast: false
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: aarch64-ubuntu
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-02-23 16:34:19 +11:00
|
|
|
uses: actions/checkout@v4
|
2024-02-20 04:01:50 +11:00
|
|
|
- name: Install nightly Rust
|
2024-02-21 17:05:59 +11:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
2024-02-20 04:01:50 +11:00
|
|
|
with:
|
|
|
|
toolchain: nightly
|
2024-02-21 17:05:59 +11:00
|
|
|
targets: aarch64-unknown-linux-gnu
|
2024-02-20 04:01:50 +11:00
|
|
|
- name: Install ARM64 cross-compilation dependencies
|
|
|
|
continue-on-error: true
|
|
|
|
run: |
|
|
|
|
sudo apt-get update || true
|
|
|
|
sudo dpkg --add-architecture arm64
|
|
|
|
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted" | sudo tee -a /etc/apt/sources.list
|
|
|
|
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list
|
|
|
|
sudo apt-get update || true
|
|
|
|
sudo apt-get -y install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
|
|
|
|
- name: Build dynamic library
|
|
|
|
run: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo run -p librashader-build-script -- --profile ${{ matrix.profile }} --target aarch64-unknown-linux-gnu
|
|
|
|
- name: Upload build artifacts
|
|
|
|
uses: actions/upload-artifact@v3.1.2
|
|
|
|
with:
|
|
|
|
name: ${{ format('librashader-aarch64-ubuntu-{0}-{1}', github.sha, matrix.profile) }}
|
|
|
|
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader.*', matrix.profile) }}
|
2024-02-21 09:55:46 +11:00
|
|
|
build-windows-arm64:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
profile: ['debug', 'release', 'optimized']
|
|
|
|
fail-fast: false
|
|
|
|
runs-on: windows-latest
|
|
|
|
name: aarch64-windows
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-02-23 16:34:19 +11:00
|
|
|
uses: actions/checkout@v4
|
2024-02-21 09:55:46 +11:00
|
|
|
- name: Install nightly Rust
|
2024-02-21 17:05:59 +11:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
2024-02-21 09:55:46 +11:00
|
|
|
with:
|
2024-02-21 10:26:51 +11:00
|
|
|
toolchain: nightly-2024-01-15 # pinned because it seems like there's a segfault on nightly
|
2024-02-21 09:55:46 +11:00
|
|
|
override: true
|
2024-02-21 17:05:59 +11:00
|
|
|
targets: aarch64-pc-windows-msvc
|
2024-02-21 09:55:46 +11:00
|
|
|
- name: Build dynamic library
|
|
|
|
run: cargo run -p librashader-build-script -- --profile ${{ matrix.profile }} --target aarch64-pc-windows-msvc
|
|
|
|
- name: Upload build artifacts
|
|
|
|
uses: actions/upload-artifact@v3.1.2
|
|
|
|
with:
|
|
|
|
name: ${{ format('librashader-aarch64-windows-{0}-{1}', github.sha, matrix.profile) }}
|
|
|
|
path: ${{ format('target/aarch64-pc-windows-msvc/{0}/librashader.*', matrix.profile) }}
|