Skip to content
Merged
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
142 changes: 76 additions & 66 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,30 @@ name: build librashader-capi

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]
schedule:
- cron: "0 0 * * 6"
env:
CARGO_TERM_COLOR: always

jobs:
doc:
name: Build docs.rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@nightly
with:
targets: "x86_64-pc-windows-msvc,x86_64-unknown-linux-gnu,x86_64-apple-darwin,aarch64-apple-darwin,aarch64-apple-ios,i686-pc-windows-msvc,i686-unknown-linux-gnu"
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs -p librashader
build:
strategy:
matrix:
profile: ['debug', 'release', 'optimized']
os: ['windows-latest', 'ubuntu-latest', 'macos-latest', 'macos-14']
profile: ["debug", "release", "optimized"]
os: ["windows-latest", "ubuntu-latest", "macos-latest", "macos-14"]
include:
- os: ubuntu-latest
output: x86_64-ubuntu
Expand All @@ -29,77 +39,77 @@ jobs:
runs-on: ${{ matrix.os }}
name: ${{ matrix.output }} (${{ matrix.profile }})
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nightly Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Build dynamic library
run: cargo run -p librashader-build-script -- --profile ${{ matrix.profile }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4.4.0
with:
name: ${{ format('librashader-{0}-{1}-{2}', matrix.output, github.sha, matrix.profile) }}
path: ${{ format('target/{0}/librashader.*', matrix.profile) }}
- name: Install Ubuntu librashader CLI build dependencies
if: matrix.profile == 'release' && matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update || true
sudo apt-get -y install xorg-dev
- name: Build librashader CLI
if: matrix.profile == 'release'
run: cargo build -p librashader-cli --release
- name: Upload librashader-cli
uses: actions/upload-artifact@v4.4.0
if: matrix.profile == 'release'
with:
name: ${{ format('librashader-cli-{0}-{1}', matrix.output, github.sha) }}
path: ${{ format('target/{0}/librashader-cli*', matrix.profile) }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nightly Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Build dynamic library
run: cargo run -p librashader-build-script -- --profile ${{ matrix.profile }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4.4.0
with:
name: ${{ format('librashader-{0}-{1}-{2}', matrix.output, github.sha, matrix.profile) }}
path: ${{ format('target/{0}/librashader.*', matrix.profile) }}
- name: Install Ubuntu librashader CLI build dependencies
if: matrix.profile == 'release' && matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update || true
sudo apt-get -y install xorg-dev
- name: Build librashader CLI
if: matrix.profile == 'release'
run: cargo build -p librashader-cli --release
- name: Upload librashader-cli
uses: actions/upload-artifact@v4.4.0
if: matrix.profile == 'release'
with:
name: ${{ format('librashader-cli-{0}-{1}', matrix.output, github.sha) }}
path: ${{ format('target/{0}/librashader-cli*', matrix.profile) }}
build-ubuntu-arm64:
strategy:
matrix:
profile: ['debug', 'release', 'optimized']
profile: ["debug", "release", "optimized"]
fail-fast: false
runs-on: ubuntu-latest
name: aarch64-ubuntu
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nightly Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: aarch64-unknown-linux-gnu
- 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 noble main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-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 xorg-dev libx11-dev:arm64 libxrandr-dev:arm64
- 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@v4.4.0
with:
name: ${{ format('librashader-aarch64-ubuntu-{0}-{1}', github.sha, matrix.profile) }}
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader.*', matrix.profile) }}
- name: Build librashader CLI
if: matrix.profile == 'release'
run: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo build -p librashader-cli --release --target aarch64-unknown-linux-gnu
- name: Upload librashader-cli
uses: actions/upload-artifact@v4.4.0
if: matrix.profile == 'release'
with:
name: ${{ format('librashader-cli-aarch64-ubuntu-{0}', github.sha) }}
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader-cli', matrix.profile) }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nightly Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: aarch64-unknown-linux-gnu
- 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 noble main restricted" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-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 xorg-dev libx11-dev:arm64 libxrandr-dev:arm64
- 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@v4.4.0
with:
name: ${{ format('librashader-aarch64-ubuntu-{0}-{1}', github.sha, matrix.profile) }}
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader.*', matrix.profile) }}
- name: Build librashader CLI
if: matrix.profile == 'release'
run: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo build -p librashader-cli --release --target aarch64-unknown-linux-gnu
- name: Upload librashader-cli
uses: actions/upload-artifact@v4.4.0
if: matrix.profile == 'release'
with:
name: ${{ format('librashader-cli-aarch64-ubuntu-{0}', github.sha) }}
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader-cli', matrix.profile) }}
build-windows-arm64:
strategy:
matrix:
profile: ['debug', 'release', 'optimized']
profile: ["debug", "release", "optimized"]
fail-fast: false
runs-on: windows-latest
name: aarch64-windows
Expand Down Expand Up @@ -130,7 +140,7 @@ jobs:
build-windows-7:
strategy:
matrix:
profile: ['release', 'optimized']
profile: ["release", "optimized"]
fail-fast: false
runs-on: windows-latest
name: x86_64-win7-windows
Expand Down
Loading