Skip to content

Commit

Permalink
ci: update deps and the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Dec 26, 2023
1 parent 9fd5c6d commit 2dab334
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 77 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:

- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: '00:00'
timezone: UTC
open-pull-requests-limit: 10
commit-message:
prefix: "chore"
include: "scope"
labels:
- "dependabot"
- "dependencies"
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"conan": {
"enabled": true
}
}
128 changes: 52 additions & 76 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on: [push, pull_request]

env:
# Vulkan version
UNIX_VULKAN_VERSION: 1.2.148
WINDOWS_VULKAN_VERSION: 1.2.148.0
UNIX_VULKAN_VERSION: 1.2.198
WINDOWS_VULKAN_VERSION: 1.2.198.1

# Conan cache environment variables
CONAN_SYSREQUIRES_MODE: enabled
Expand All @@ -22,18 +22,30 @@ jobs:
strategy:
fail-fast: false
matrix:
compiler: [
g++-7, g++-8, g++-9, g++,
clang++-8, clang++-9, clang++
]

runs-on: ubuntu-latest
include:
- compiler: g++
version: 7
cxx: g++-7
- compiler: g++
version: 8
cxx: g++-8
- compiler: g++
version: 9
cxx: g++-9
- compiler: clang
version: 9
cxx: clang++-9
- compiler: clang
version: 10
cxx: clang++-10

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-conan-pip-chocolatey-modules
with:
Expand All @@ -44,34 +56,15 @@ jobs:
${{ env.CPM_SOURCE_CACHE }}
key: ubuntu-${{ hashFiles('conanfile.txt') }} }}

- name: Install g++-7
if: ${{ matrix.compiler == 'g++-7' }}
run: |
sudo apt-get update
sudo apt-get install g++-7 -y
- name: Install g++-8
if: ${{ matrix.compiler == 'g++-8' }}
run: |
sudo apt-get update
sudo apt-get install g++-8 -y
- name: Install clang-8
if: ${{ matrix.compiler == 'clang++-8' }}
run: |
sudo apt-get update
sudo apt-get install clang-8 -y
- name: Install clang-9
if: ${{ matrix.compiler == 'clang++-9' }}
- name: Install compiler
run: |
sudo apt-get update
sudo apt-get install clang-9 -y
sudo apt-get install ${{ matrix.compiler }}-${{ matrix.version }}
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.6
python-version: '3.10'

- name: Install Build Dependencies
run: |
Expand All @@ -83,22 +76,20 @@ jobs:
clang --version
- name: Install Conan
run: |
pip -VV
pip install --upgrade pip setuptools wheel conan
run: python -m pip install conan==1.*

- name: Install Ubuntu Dependencies
run: |
sudo apt-get update
sudo apt-get install freeglut3-dev \
libxi-dev libxinerama-dev libxcursor-dev xorg-dev \
libxi-dev libxinerama-dev libxcb-cursor-dev xorg-dev \
libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev \
libxcb-render-util0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev \
libxcb-sync-dev libxcb-xfixes0-dev libx11-xcb-dev libxcb-dri3-dev libxcb-util-dev
- name: Install Vulkan SDK
run: |
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-$UNIX_VULKAN_VERSION-focal.list https://packages.lunarg.com/vulkan/$UNIX_VULKAN_VERSION/lunarg-vulkan-$UNIX_VULKAN_VERSION-focal.list
sudo apt update
sudo apt install -f vulkan-sdk
Expand All @@ -114,7 +105,7 @@ jobs:
shell: bash
working-directory: ${{ runner.workspace }}/build
env:
CXX: ${{ matrix.compiler }}
CXX: ${{ matrix.cxx }}
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
Expand Down Expand Up @@ -144,35 +135,19 @@ jobs:
run: cmake --install . --strip

- name: Upload
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
path: ${{ runner.workspace }}/instdir
name: ubuntu-${{ matrix.compiler }}
name: ubuntu-${{ matrix.cxx }}

windows:
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2016]
toolset: [clang-cl, default, v141]
include:
- toolset: clang-cl
toolset_option: -T"ClangCl"
- toolset: v141
toolset_option: -T"v141"
exclude:
- os: windows-2016
toolset: clang-cl
- os: windows-2016
toolset: v141

runs-on: windows-latest
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-conan-pip-chocolatey-modules
with:
Expand All @@ -190,17 +165,19 @@ jobs:
ninja --version
cmake --version
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install Conan
run: |
python -c "import sys; print(sys.version)"
python -m pip install --upgrade pip
pip install conan
run: python -m pip install conan==1.*

- name: Download Vulkan SDK
run: Invoke-WebRequest "https://sdk.lunarg.com/sdk/download/$Env:WINDOWS_VULKAN_VERSION/windows/VulkanSDK-$Env:WINDOWS_VULKAN_VERSION-Installer.exe" -OutFile VulkanSDK.exe -v

- name: Install Vulkan SDK
run: .\VulkanSDK.exe /S
run: .\VulkanSDK.exe --accept-licenses --default-answer --confirm-command install
shell: cmd

- name: Create Build Environment
Expand All @@ -210,8 +187,7 @@ jobs:
shell: bash
working-directory: ${{runner.workspace}}/build
env:
CXX: ${{ matrix.compiler }}
VULKAN_SDK: "C:\\VulkanSDK\\${{ env.WINDOWS_VULKAN_VERSION }}"
VULKAN_SDK: "C:\\VulkanSDK\\${{ env.WINDOWS_VULKAN_VERSION }}"
run: |
cmake \
$GITHUB_WORKSPACE \
Expand All @@ -223,39 +199,39 @@ jobs:
shell: bash
run: cmake --build . --config Release
env:
VULKAN_SDK: "C:\\VulkanSDK\\${{ env.WINDOWS_VULKAN_VERSION }}"
VULKAN_SDK: "C:\\VulkanSDK\\${{ env.WINDOWS_VULKAN_VERSION }}"

- name: Run tests
working-directory: ${{ runner.workspace }}/build
env:
CTEST_OUTPUT_ON_FAILURE: 1
VULKAN_SDK: "C:\\VulkanSDK\\${{ env.WINDOWS_VULKAN_VERSION }}"
VULKAN_SDK: "C:\\VulkanSDK\\${{ env.WINDOWS_VULKAN_VERSION }}"
run: ctest --timeout 10 -C Release -j4

- name: Install Strip
working-directory: ${{ runner.workspace }}/build
shell: bash
run: cmake --install . --strip
env:
VULKAN_SDK: "C:\\VulkanSDK\\${{ env.WINDOWS_VULKAN_VERSION }}"
VULKAN_SDK: "C:\\VulkanSDK\\${{ env.WINDOWS_VULKAN_VERSION }}"

- name: Upload
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
path: ${{ runner.workspace }}/instdir
name: windows-${{ matrix.toolset }}
name: windows-msvc

docs:
name: Publish documentation
runs-on: macos-latest
runs-on: ubuntu-latest
needs: linux

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: ubuntu-g++
name: ubuntu-g++-9
path: ${{ runner.workspace }}

- name: Display structure of downloaded files
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/florianvazelle/VulkanStarter/build/main?label=Windows%20%7C%20Linux&logo=github)
![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/florianvazelle/VulkanStarter/main.yml?branch=main&label=Windows%20%7C%20Linux&logo=github)

# VulkanStarter

This is a template to setting up a new Vulkan C++ project.
Expand Down

0 comments on commit 2dab334

Please sign in to comment.