|
13 | 13 |
|
14 | 14 | jobs:
|
15 | 15 | Build:
|
16 |
| - runs-on: ${{ matrix.os }} |
| 16 | + name: ${{ format('{0} {1}', matrix.platform.target, matrix.features)}} |
| 17 | + runs-on: ${{ matrix.platform.os }} |
| 18 | + env: |
| 19 | + RUST_BACKTRACE: 1 |
17 | 20 | strategy:
|
18 | 21 | fail-fast: false
|
19 | 22 | matrix:
|
20 |
| - os: [macos-latest, ubuntu-22.04, windows-latest] |
21 |
| - rust: [stable] |
22 |
| - features: ["", "--features 'chains sm-raw-window-handle-06'", "--features 'chains sm-raw-window-handle-05'"] |
23 |
| - target: ["default"] |
| 23 | + platform: |
| 24 | + - { target: aarch64-apple-darwin, os: macos-14, test: true } |
| 25 | + - { target: x86_64-apple-darwin, os: macos-13, test: true } |
| 26 | + - { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04, test: true } |
| 27 | + - { target: x86_64-pc-windows-msvc, os: windows-latest, test: true } |
| 28 | + - { target: i686-pc-windows-msvc, os: windows-latest, test: false } |
| 29 | + - { target: aarch64-pc-windows-msvc, os: windows-latest, test: false } |
| 30 | + - { |
| 31 | + target: aarch64-unknown-linux-ohos, |
| 32 | + os: ubuntu-24.04, |
| 33 | + test: false, |
| 34 | + } |
| 35 | + - { target: arm-linux-androideabi, os: ubuntu-24.04, test: false } |
| 36 | + features: |
| 37 | + [ |
| 38 | + "", |
| 39 | + "chains sm-raw-window-handle-06", |
| 40 | + "chains sm-raw-window-handle-05", |
| 41 | + ] |
24 | 42 | include:
|
25 |
| - # rust stable |
26 |
| - - os: ubuntu-22.04 |
27 |
| - features: "--features 'sm-x11 sm-wayland-default'" |
28 |
| - rust: stable |
29 |
| - target: "default" |
30 |
| - - os: ubuntu-22.04 |
31 |
| - target: "arm-linux-androideabi" |
32 |
| - rust: stable |
33 |
| - - os: windows-latest |
34 |
| - features: "--features 'chains sm-angle-builtin'" |
35 |
| - rust: stable |
36 |
| - target: "default" |
37 |
| - - os: windows-latest |
38 |
| - features: "--features 'chains sm-no-wgl sm-angle-builtin'" |
39 |
| - rust: stable |
40 |
| - target: "default" |
41 |
| - - os: windows-latest |
42 |
| - target: "aarch64-pc-windows-msvc" |
43 |
| - rust: stable |
44 |
| - - os: ubuntu-22.04 |
45 |
| - target: "aarch64-unknown-linux-ohos" |
46 |
| - rust: stable |
| 43 | + - features: "sm-x11 sm-wayland-default" |
| 44 | + platform: |
| 45 | + { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04, test: true } |
| 46 | + - features: "chains sm-angle-builtin" |
| 47 | + platform: |
| 48 | + { target: x86_64-pc-windows-msvc, os: windows-latest, test: true } |
| 49 | + - features: "chains sm-no-wgl sm-angle-builtin" |
| 50 | + platform: |
| 51 | + { target: x86_64-pc-windows-msvc, os: windows-latest, test: true } |
47 | 52 | steps:
|
48 |
| - - uses: actions/checkout@v4 |
49 |
| - - name: Install dependencies (Linux) |
50 |
| - if: startsWith(matrix.os, 'ubuntu') |
51 |
| - run: | |
52 |
| - sudo apt update |
53 |
| - sudo apt install gcc libxxf86vm-dev libosmesa6-dev libgles2-mesa-dev -y |
54 |
| - - name: Install rust |
55 |
| - id: toolchain |
56 |
| - uses: dtolnay/rust-toolchain@master |
57 |
| - with: |
58 |
| - toolchain: ${{ matrix.rust }} |
59 |
| - - name: Build target |
60 |
| - if: matrix.target != 'default' && startsWith(matrix.target, 'aarch64-uwp-windows-msvc') != true |
61 |
| - run: | |
62 |
| - rustup +${{steps.toolchain.outputs.name}} target add ${{ matrix.target }} |
63 |
| - cargo +${{steps.toolchain.outputs.name}} build --verbose ${{ matrix.features }} --target=${{ matrix.target }} |
64 |
| - - name: Build |
65 |
| - if: matrix.target == 'default' |
66 |
| - run: | |
67 |
| - cargo +${{steps.toolchain.outputs.name}} build --verbose ${{ matrix.features }} |
68 |
| - - name: Build Windows |
69 |
| - if: startsWith(matrix.target, 'aarch64-uwp-windows-msvc') |
70 |
| - shell: cmd |
71 |
| - run: | |
72 |
| - rustup +${{steps.toolchain.outputs.name}} component add rust-src --target=aarch64-uwp-windows-msvc |
73 |
| - cargo +${{steps.toolchain.outputs.name}} build -Z build-std --verbose --target=aarch64-uwp-windows-msvc |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + - name: Install dependencies (Linux) |
| 55 | + if: startsWith(matrix.platform.os, 'ubuntu') |
| 56 | + run: | |
| 57 | + sudo apt update |
| 58 | + sudo apt install gcc libxxf86vm-dev libosmesa6-dev libgles2-mesa-dev xvfb weston -y |
| 59 | + - name: Install rust |
| 60 | + id: toolchain |
| 61 | + uses: dtolnay/rust-toolchain@stable |
| 62 | + with: |
| 63 | + targets: ${{ matrix.platform.target }} |
| 64 | + - name: Build |
| 65 | + run: | |
| 66 | + rustup target add ${{ matrix.platform.target }} |
| 67 | + cargo build --features "${{ matrix.features }}" --target ${{ matrix.platform.target }} |
| 68 | + - name: Test |
| 69 | + if: ${{ matrix.platform.test && startsWith(matrix.platform.os, 'ubuntu') }} |
| 70 | + run: | |
| 71 | + weston --no-config --socket=wl-test-env --backend=headless & |
| 72 | + WAYLAND_DISPLAY=wl-test-env xvfb-run cargo test --features "${{ matrix.features }}" --target ${{ matrix.platform.target }} |
| 73 | + - name: Test |
| 74 | + if: ${{ matrix.platform.test && !startsWith(matrix.platform.os, 'ubuntu') }} |
| 75 | + run: | |
| 76 | + cargo test --features "${{ matrix.features }}" --target ${{ matrix.platform.target }} |
74 | 77 | Format:
|
75 | 78 | name: Run `rustfmt`
|
76 |
| - runs-on: ubuntu-latest |
| 79 | + runs-on: ubuntu-24.04 |
77 | 80 | steps:
|
78 | 81 | - uses: actions/checkout@v4
|
79 | 82 | - uses: mkroening/rust-toolchain-toml@main
|
80 | 83 | - run: cargo fmt --check
|
81 | 84 | build_result:
|
82 | 85 | name: Result
|
83 |
| - runs-on: ubuntu-latest |
| 86 | + runs-on: ubuntu-24.04 |
84 | 87 | needs: ["Build", "Format"]
|
85 | 88 | if: always()
|
86 | 89 | steps:
|
|
0 commit comments