Skip to content

Commit

Permalink
Switch CI to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Aug 26, 2020
1 parent 8dcbf11 commit cbaf5ba
Show file tree
Hide file tree
Showing 28 changed files with 65,307 additions and 119 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Check

on:
push:
branches-ignore: [staging.tmp]
pull_request:
branches-ignore: [staging.tmp]

jobs:
ios_build:
name: iOS Stable
runs-on: macos-10.15
env:
TARGET: aarch64-apple-ios
steps:
- uses: actions/checkout@v2
- run: rustup target add ${{ env.TARGET }}
- run: make check-target

build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-10.15, windows-2019]
channel: [stable, nightly]
exclude:
- os: ubuntu-18.04
channel: stable
- os: macos-10.15
channel: nightly
- os: windows-2019
channel: nightly
include:
- name: Ubuntu Nightly
os: ubuntu-18.04
channel: nightly
- name: MacOS Stable
os: macos-10.15
channel: stable
- name: Windows Stable
os: windows-2019
channel: stable
steps:
- name: Checkout code
uses: actions/checkout@v2
- if: matrix.channel == 'nightly'
name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- if: matrix.os == 'windows-2019'
name: Install make
run: choco install make
- run: make all
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
release:
types: [published]

name: Release

jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, windows-2019]
include:
- name: MacOS Stable
os: macos-10.15
key: macos
- name: Windows Stable
os: windows-2019
key: windows
steps:
- uses: actions/checkout@v2
- if: matrix.os == 'windows-2019'
name: Install make
run: choco install make
- run: make gfx-portability.zip
- name: Upload builds
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./gfx-portability.zip
asset_name: gfx-portability-${{ matrix.key }}-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

69 changes: 0 additions & 69 deletions .travis.yml

This file was deleted.

42 changes: 25 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
VULKAN_DIR=modules/vulkan-docs/src
CTS_DIR=../VK-GL-CTS
CHERRY_DIR=../cherry
BINDING=target/vulkan.rs
NATIVE_DIR=target/native
NATIVE_TARGET=$(NATIVE_DIR)/test
NATIVE_OBJECTS=$(NATIVE_DIR)/test.o $(NATIVE_DIR)/window.o
LIB_EXTENSION=
LIB_FILE_NAME=
LIB_VULKAN_NAME=
TEST_LIST=$(CURDIR)/conformance/deqp.txt
TEST_LIST_SOURCE=$(CTS_DIR)/external/vulkancts/mustpass/1.0.2/vk-default.txt
DEQP_DIR=$(CTS_DIR)/build/external/vulkancts/modules/vulkan/
DEQP=cd $(DEQP_DIR) && RUST_LOG=debug LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) ./deqp-vk
CLINK_ARGS=
GIT_TAG=$(shell git describe --abbrev=0 --tags)
GIT_TAG_FULL=$(shell git describe --tags)
OS_NAME=
ZIP_COMMAND=

DOTA_DIR=../dota2/bin/osx64
DOTA_EXE=$(DOTA_DIR)/dota2.app/Contents/MacOS/dota2
Expand All @@ -29,38 +29,43 @@ DEBUGGER=rust-gdb --args
GFX_METAL_RECORDING:=immediate

CC=g++
CFLAGS=-std=c++11 -ggdb -O0 -I$(VULKAN_DIR)
CFLAGS=-std=c++11 -ggdb -O0 -Iheaders
DEPS=
LDFLAGS=

ifeq ($(OS),Windows_NT)
LDFLAGS=
BACKEND=dx12
LIB_EXTENSION=dll
LIB_FILE_NAME=portability.dll
LIB_VULKAN_NAME=vulkan.dll
OS_NAME=windows
ZIP_COMMAND=7z a -tzip
else
UNAME_S:=$(shell uname -s)
ZIP_COMMAND=zip
ifeq ($(UNAME_S),Linux)
LDFLAGS=-lpthread -ldl -lm -lX11 -lxcb
BACKEND=vulkan
LIB_EXTENSION=so
LIB_FILE_NAME=libportability.so
LIB_VULKAN_NAME=libvulkan.so
OS_NAME=linux
endif
ifeq ($(UNAME_S),Darwin)
LDFLAGS=-lpthread -ldl -lm
BACKEND=metal
DEBUGGER=rust-lldb --
LIB_EXTENSION=dylib
LIB_FILE_NAME=libportability.dylib
LIB_VULKAN_NAME=libvulkan.dylib
CLINK_ARGS=-- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0"
OS_NAME=macos
endif
endif

FULL_LIBRARY_PATH=$(CURDIR)/target/debug
LIBRARY=target/debug/libportability.$(LIB_EXTENSION)
LIBRARY_FAST=target/release/libportability.$(LIB_EXTENSION)
LIBRARY=target/debug/$(LIB_FILE_NAME)
LIBRARY_FAST=target/release/$(LIB_FILE_NAME)

.PHONY: all dummy rebuild debug release version-debug version-release binding run-native cts clean cherry dota-debug dota-release dota-orig dota-bench-gfx dota-bench-orig dota-bench-gl package memcpy-report
.PHONY: all dummy check-target rebuild debug release version-debug version-release binding run-native cts clean cherry dota-debug dota-release dota-orig dota-bench-gfx dota-bench-orig dota-bench-gl memcpy-report

all: $(NATIVE_TARGET)

Expand All @@ -80,6 +85,9 @@ version-debug:
version-release:
cargo rustc --release --manifest-path libportability/Cargo.toml --features $(BACKEND) $(CLINK_ARGS)

check-target:
cargo check --manifest-path libportability/Cargo.toml --target $(TARGET) --features $(BACKEND)
cargo check --manifest-path libportability-icd/Cargo.toml --target $(TARGET) --features $(BACKEND),portability-gfx/env_logger

dota-debug: version-debug $(DOTA_EXE)
DYLD_LIBRARY_PATH=$(CURDIR)/target/debug:$(CURDIR)/$(DOTA_DIR) $(DOTA_EXE) $(DOTA_PARAMS)
Expand Down Expand Up @@ -116,8 +124,8 @@ endif

binding: $(BINDING)

$(BINDING): $(VULKAN_DIR)/vulkan/*.h
bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING)
$(BINDING): headers/vulkan/*.h
bindgen --no-layout-tests --rustfmt-bindings headers/vulkan/vulkan.h -o $(BINDING)

$(LIBRARY): dummy
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND)
Expand Down Expand Up @@ -163,16 +171,16 @@ clean:
rm -f $(NATIVE_OBJECTS) $(NATIVE_TARGET) $(BINDING)
cargo clean

package: version-debug version-release
gfx-portability.zip: version-debug version-release
cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND)
cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND) --release
echo "$(GIT_TAG_FULL)" > commit-sha
zip gfx-portability-$(OS_NAME)-$(GIT_TAG).zip target/*/libportability*.$(LIB_EXTENSION) libportability-icd/portability-$(OS_NAME)-*.json commit-sha
$(ZIP_COMMAND) gfx-portability.zip target/*/$(LIB_FILE_NAME) libportability-icd/portability-$(OS_NAME)-*.json commit-sha

target/debug/libvulkan.$(LIB_EXTENSION):
cd target/debug && ln -sf libportability.$(LIB_EXTENSION) libvulkan.$(LIB_EXTENSION)
target/debug/$(LIB_VULKAN_NAME):
cd target/debug && ln -sf $(LIB_FILE_NAME) $(LIB_VULKAN_NAME)

cherry: $(LIBRARY) target/debug/libvulkan.$(LIB_EXTENSION)
cherry: $(LIBRARY) $(LIB_VULKAN_NAME)
cd $(CHERRY_DIR) && rm -f Cherry.db && RUST_LOG=warn LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) go run server.go

memcpy-report:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## gfx-portability
[![Build Status](https://travis-ci.org/gfx-rs/portability.svg?branch=master)](https://travis-ci.org/gfx-rs/portability)
[![Gitter](https://badges.gitter.im/gfx-rs/portability.svg)](https://gitter.im/gfx-rs/portability)
[![Build Status](https://github.com/gfx-rs/portability/workflows/check/badge.svg?branch=master)](https://github.com/gfx-rs/portability/actions)
[![Matrix](https://img.shields.io/badge/Matrix-%23gfx%3Amatrix.org-blueviolet.svg)](https://matrix.to/#/#gfx:matrix.org)

This is a prototype library implementing [Vulkan Portability Initiative](https://www.khronos.org/blog/khronos-announces-the-vulkan-portability-initiative) using [gfx-hal](http://gfx-rs.github.io/2017/07/24/low-level.html). See gfx-rs [meta issue](https://github.com/gfx-rs/gfx/issues/1354) for backend limitations and further details.

Expand Down
23 changes: 0 additions & 23 deletions appveyor.yml

This file was deleted.

5 changes: 3 additions & 2 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
status = [
"continuous-integration/travis-ci/push",
"continuous-integration/appveyor/branch"
"Ubuntu Nightly",
"MacOS Stable",
"Windows Stable",
]
Loading

0 comments on commit cbaf5ba

Please sign in to comment.