Skip to content

Commit a83e221

Browse files
committed
docs: build docs.rs
1 parent ad661b6 commit a83e221

File tree

5 files changed

+391
-391
lines changed

5 files changed

+391
-391
lines changed

.github/workflows/build.yml

Lines changed: 76 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,30 @@ name: build librashader-capi
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: ["master"]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: ["master"]
88
schedule:
99
- cron: "0 0 * * 6"
1010
env:
1111
CARGO_TERM_COLOR: always
1212

1313
jobs:
14+
doc:
15+
name: Build docs.rs
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v5
19+
- uses: dtolnay/rust-toolchain@nightly
20+
with:
21+
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"
22+
- uses: dtolnay/install@cargo-docs-rs
23+
- run: cargo docs-rs -p librashader
1424
build:
1525
strategy:
1626
matrix:
17-
profile: ['debug', 'release', 'optimized']
18-
os: ['windows-latest', 'ubuntu-latest', 'macos-latest', 'macos-14']
27+
profile: ["debug", "release", "optimized"]
28+
os: ["windows-latest", "ubuntu-latest", "macos-latest", "macos-14"]
1929
include:
2030
- os: ubuntu-latest
2131
output: x86_64-ubuntu
@@ -29,77 +39,77 @@ jobs:
2939
runs-on: ${{ matrix.os }}
3040
name: ${{ matrix.output }} (${{ matrix.profile }})
3141
steps:
32-
- name: Checkout repository
33-
uses: actions/checkout@v4
34-
- name: Install nightly Rust
35-
uses: dtolnay/rust-toolchain@master
36-
with:
37-
toolchain: nightly
38-
- name: Build dynamic library
39-
run: cargo run -p librashader-build-script -- --profile ${{ matrix.profile }}
40-
- name: Upload build artifacts
41-
uses: actions/upload-artifact@v4.4.0
42-
with:
43-
name: ${{ format('librashader-{0}-{1}-{2}', matrix.output, github.sha, matrix.profile) }}
44-
path: ${{ format('target/{0}/librashader.*', matrix.profile) }}
45-
- name: Install Ubuntu librashader CLI build dependencies
46-
if: matrix.profile == 'release' && matrix.os == 'ubuntu-latest'
47-
run: |
48-
sudo apt-get update || true
49-
sudo apt-get -y install xorg-dev
50-
- name: Build librashader CLI
51-
if: matrix.profile == 'release'
52-
run: cargo build -p librashader-cli --release
53-
- name: Upload librashader-cli
54-
uses: actions/upload-artifact@v4.4.0
55-
if: matrix.profile == 'release'
56-
with:
57-
name: ${{ format('librashader-cli-{0}-{1}', matrix.output, github.sha) }}
58-
path: ${{ format('target/{0}/librashader-cli*', matrix.profile) }}
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
- name: Install nightly Rust
45+
uses: dtolnay/rust-toolchain@master
46+
with:
47+
toolchain: nightly
48+
- name: Build dynamic library
49+
run: cargo run -p librashader-build-script -- --profile ${{ matrix.profile }}
50+
- name: Upload build artifacts
51+
uses: actions/upload-artifact@v4.4.0
52+
with:
53+
name: ${{ format('librashader-{0}-{1}-{2}', matrix.output, github.sha, matrix.profile) }}
54+
path: ${{ format('target/{0}/librashader.*', matrix.profile) }}
55+
- name: Install Ubuntu librashader CLI build dependencies
56+
if: matrix.profile == 'release' && matrix.os == 'ubuntu-latest'
57+
run: |
58+
sudo apt-get update || true
59+
sudo apt-get -y install xorg-dev
60+
- name: Build librashader CLI
61+
if: matrix.profile == 'release'
62+
run: cargo build -p librashader-cli --release
63+
- name: Upload librashader-cli
64+
uses: actions/upload-artifact@v4.4.0
65+
if: matrix.profile == 'release'
66+
with:
67+
name: ${{ format('librashader-cli-{0}-{1}', matrix.output, github.sha) }}
68+
path: ${{ format('target/{0}/librashader-cli*', matrix.profile) }}
5969
build-ubuntu-arm64:
6070
strategy:
6171
matrix:
62-
profile: ['debug', 'release', 'optimized']
72+
profile: ["debug", "release", "optimized"]
6373
fail-fast: false
6474
runs-on: ubuntu-latest
6575
name: aarch64-ubuntu
6676
steps:
67-
- name: Checkout repository
68-
uses: actions/checkout@v4
69-
- name: Install nightly Rust
70-
uses: dtolnay/rust-toolchain@master
71-
with:
72-
toolchain: nightly
73-
targets: aarch64-unknown-linux-gnu
74-
- name: Install ARM64 cross-compilation dependencies
75-
continue-on-error: true
76-
run: |
77-
sudo apt-get update || true
78-
sudo dpkg --add-architecture arm64
79-
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted" | sudo tee -a /etc/apt/sources.list
80-
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted" | sudo tee -a /etc/apt/sources.list
81-
sudo apt-get update || true
82-
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
83-
- name: Build dynamic library
84-
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
85-
- name: Upload build artifacts
86-
uses: actions/upload-artifact@v4.4.0
87-
with:
88-
name: ${{ format('librashader-aarch64-ubuntu-{0}-{1}', github.sha, matrix.profile) }}
89-
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader.*', matrix.profile) }}
90-
- name: Build librashader CLI
91-
if: matrix.profile == 'release'
92-
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
93-
- name: Upload librashader-cli
94-
uses: actions/upload-artifact@v4.4.0
95-
if: matrix.profile == 'release'
96-
with:
97-
name: ${{ format('librashader-cli-aarch64-ubuntu-{0}', github.sha) }}
98-
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader-cli', matrix.profile) }}
77+
- name: Checkout repository
78+
uses: actions/checkout@v4
79+
- name: Install nightly Rust
80+
uses: dtolnay/rust-toolchain@master
81+
with:
82+
toolchain: nightly
83+
targets: aarch64-unknown-linux-gnu
84+
- name: Install ARM64 cross-compilation dependencies
85+
continue-on-error: true
86+
run: |
87+
sudo apt-get update || true
88+
sudo dpkg --add-architecture arm64
89+
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted" | sudo tee -a /etc/apt/sources.list
90+
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted" | sudo tee -a /etc/apt/sources.list
91+
sudo apt-get update || true
92+
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
93+
- name: Build dynamic library
94+
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
95+
- name: Upload build artifacts
96+
uses: actions/upload-artifact@v4.4.0
97+
with:
98+
name: ${{ format('librashader-aarch64-ubuntu-{0}-{1}', github.sha, matrix.profile) }}
99+
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader.*', matrix.profile) }}
100+
- name: Build librashader CLI
101+
if: matrix.profile == 'release'
102+
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
103+
- name: Upload librashader-cli
104+
uses: actions/upload-artifact@v4.4.0
105+
if: matrix.profile == 'release'
106+
with:
107+
name: ${{ format('librashader-cli-aarch64-ubuntu-{0}', github.sha) }}
108+
path: ${{ format('target/aarch64-unknown-linux-gnu/{0}/librashader-cli', matrix.profile) }}
99109
build-windows-arm64:
100110
strategy:
101111
matrix:
102-
profile: ['debug', 'release', 'optimized']
112+
profile: ["debug", "release", "optimized"]
103113
fail-fast: false
104114
runs-on: windows-latest
105115
name: aarch64-windows
@@ -130,7 +140,7 @@ jobs:
130140
build-windows-7:
131141
strategy:
132142
matrix:
133-
profile: ['release', 'optimized']
143+
profile: ["release", "optimized"]
134144
fail-fast: false
135145
runs-on: windows-latest
136146
name: x86_64-win7-windows

0 commit comments

Comments
 (0)