Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test rust code in CI #32

Merged
merged 1 commit into from
Jan 19, 2024
Merged
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
94 changes: 24 additions & 70 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
name: Build
on:
pull_request:
push:
branches: [ ci, master, latest, 3.3-stable ]
permissions:
statuses: write
contents: read
on: [push, pull_request]

jobs:

build-linux-x11-clang:
name: X11 (Linux, Clang)
runs-on: ubuntu-latest
env:
CC: clang
CFLAGS: -Werror
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev

- name: Configure static library
run: cmake -S . -B build-static
- name: Build static library
run: cmake --build build-static --parallel

- name: Configure shared library
run: cmake -S . -B build-shared -D BUILD_SHARED_LIBS=ON
- name: Build shared library
run: cmake --build build-shared --parallel
- name: Tests
run: cargo test

build-linux-wayland-clang:
name: Wayland (Linux, Clang)
Expand All @@ -38,44 +28,16 @@ jobs:
CC: clang
CFLAGS: -Werror
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update
sudo apt install wayland-protocols libwayland-dev libxkbcommon-dev extra-cmake-modules

- name: Configure static library
run: cmake -S . -B build-static -D GLFW_USE_WAYLAND=ON
- name: Build static library
run: cmake --build build-static --parallel

- name: Configure shared library
run: cmake -S . -B build-shared -D GLFW_USE_WAYLAND=ON -D BUILD_SHARED_LIBS=ON
- name: Build shared library
run: cmake --build build-shared --parallel

build-linux-null-clang:
name: Null (Linux, Clang)
runs-on: ubuntu-latest
env:
CC: clang
CFLAGS: -Werror
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install libosmesa6-dev

- name: Configure static library
run: cmake -S . -B build-static -D GLFW_USE_OSMESA=ON
- name: Build static library
run: cmake --build build-static --parallel

- name: Configure shared library
run: cmake -S . -B build-shared -D GLFW_USE_OSMESA=ON -D BUILD_SHARED_LIBS=ON
- name: Build shared library
run: cmake --build build-shared --parallel
- name: Tests
run: cargo test --features wayland

build-macos-cocoa-clang:
name: Cocoa (macOS, Clang)
Expand All @@ -84,33 +46,25 @@ jobs:
CFLAGS: -Werror
MACOSX_DEPLOYMENT_TARGET: 10.8
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure static library
run: cmake -S . -B build-static
- name: Build static library
run: cmake --build build-static --parallel

- name: Configure shared library
run: cmake -S . -B build-shared -D BUILD_SHARED_LIBS=ON
- name: Build shared library
run: cmake --build build-shared --parallel
- uses: dtolnay/rust-toolchain@stable
- name: Tests
run: cargo test

build-windows-win32-vs2019:
name: Win32 (Windows, VS2019)
runs-on: windows-latest
env:
CFLAGS: /WX
steps:
- uses: actions/checkout@v2

- name: Configure static library
run: cmake -S . -B build-static -G "Visual Studio 16 2019"
- name: Build static library
run: cmake --build build-static --parallel
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure shared library
run: cmake -S . -B build-shared -G "Visual Studio 16 2019" -D BUILD_SHARED_LIBS=ON
- name: Build shared library
run: cmake --build build-shared --parallel
- uses: dtolnay/rust-toolchain@stable
- name: Tests
run: cargo test