Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed May 13, 2024
1 parent 827d59d commit c88b358
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 22 deletions.
18 changes: 18 additions & 0 deletions .github/actions/install-clang/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Install Clang
description: Install Clang.

inputs:
clang_version:
description: The version of Clang.
required: true

runs:
using: "composite"
steps:
- name: Install Clang
if: runner.os == 'Linux'
shell: bash
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ inputs.clang_version }}
4 changes: 3 additions & 1 deletion .github/actions/install-vulkan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ runs:
steps:
- name: Download Vulkan SDK
if: runner.os == 'Windows'
shell: powershell
run: Invoke-WebRequest "https://sdk.lunarg.com/sdk/download/${{ inputs.vulkan_version }}/windows/VulkanSDK-${{ inputs.vulkan_version }}-Installer.exe" -OutFile VulkanSDK.exe -v

- name: Install Vulkan SDK
if: runner.os == 'Windows'
run: .\VulkanSDK.exe --accept-licenses --default-answer --confirm-command install
shell: cmd
run: .\VulkanSDK.exe --accept-licenses --default-answer --confirm-command install

- name: Install Vulkan SDK
if: runner.os == 'Linux'
shell: bash
run: |
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-${{ inputs.vulkan_version }}-focal.list https://packages.lunarg.com/vulkan/${{ inputs.vulkan_version }}/lunarg-vulkan-${{ inputs.vulkan_version }}-focal.list
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@ jobs:

- id: set-matrix
run: |
MATRIX=$(
{
just ci-matrix | jq -Rc
} | jq -sc
)
MATRIX=$(just ci-matrix | jq -sc)
echo "$MATRIX"
echo "include=$MATRIX" >> $GITHUB_OUTPUT
linux:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-20.04
needs: [generate-matrix, check]

strategy:
Expand Down Expand Up @@ -86,10 +82,20 @@ jobs:
- name: Install Conan
run: python -m pip install conan==1.*

- name: Install Dependencies
- uses: ./.github/actions/install-clang
if: matrix.compiler == 'clang'
with:
clang_version: ${{ matrix.version }}

- name: Install GCC
if: matrix.compiler == 'gcc'
run: |
sudo apt-get update
sudo apt-get install gcc-${{ matrix.version }} g++-${{ matrix.version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ${{ matrix.compiler }}-${{ matrix.version }}
sudo apt-get install $(grep -vE "^\s*#" ./.github/apt-requirements.txt | tr "\n" " ")
- uses: ./.github/actions/install-vulkan
Expand Down Expand Up @@ -128,7 +134,7 @@ jobs:
${{ env.CPM_SOURCE_CACHE }}
key: windows-cache

- name: Install Dependencies
- name: Install dependencies
run: |
choco config set cacheLocation ${{ env.CHOCO_CACHE_DIR }}
choco install ninja cmake
Expand Down
24 changes: 12 additions & 12 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
venv_dir := justfile_directory() / "venv"

# Local directories for exports
build_dir := justfile_directory() / "build"
dist_dir := justfile_directory() / "dist"
build_dir := replace(justfile_directory() / "build", "\\", "/")
dist_dir := replace(justfile_directory() / "dist", "\\", "/")

# === Commands ===

Expand Down Expand Up @@ -53,8 +53,8 @@ makedirs:
cmake -E make_directory {{ build_dir }} {{ dist_dir }}

# Configure the build
configure build_tests="ON" gen_doc="ON" install_app="ON": makedirs
cmake {{ build_dir }} -DBUILD_TESTING={{ build_tests }} -DBUILD_DOCS={{ gen_doc }} -DINSTALL_APPS={{ install_app }} -DCMAKE_INSTALL_PREFIX="{{ dist_dir }}"
configure: makedirs
cmake -B {{ build_dir }} -DBUILD_TESTING="ON" -DBUILD_DOCS="ON" -DINSTALL_APPS="ON" -DCMAKE_INSTALL_PREFIX="{{ dist_dir }}"

# Build the project as debug
debug: configure
Expand Down Expand Up @@ -86,18 +86,18 @@ clean:
# Recipes triggered by CI steps.

[private]
@ci-row-gcc version os:
echo '{"compiler": "g++", "version": "{{ version }}", "cxx": "g++-{{ version }}", "os": "{{ os }}"}'
ci-row-gcc version:
#!/bin/bash
# NOTE: g++-12 don't seems available on ubuntu-20.04
if [[ ! "{{ version }}" == "12" ]]; then echo '{"compiler": "gcc", "version": "{{ version }}", "cxx": "g++-{{ version }}"}'; fi
[private]
@ci-row-clang version os:
echo '{compiler": "clang", "version": "{{ version }}", "cxx": "clang++-{{ version }}", "os": "{{ os }}"}'
@ci-row-clang version:
echo '{"compiler": "clang", "version": "{{ version }}", "cxx": "clang++-{{ version }}"}'
# Display the compatibility matrix for compiler versions
@ci-matrix:
# GCC (https://gcc.gnu.org/releases.html)
for i in $(seq 7 9); do just ci-row-gcc $i ubuntu-20.04; done
for i in $(seq 10 14); do just ci-row-gcc $i ubuntu-22.04; done
for i in $(seq 7 13); do just ci-row-gcc $i; done
# Clang (https://releases.llvm.org/)
for i in $(seq 9 10); do just ci-row-clang $i ubuntu-20.04; done
for i in $(seq 11 18); do just ci-row-clang $i ubuntu-22.04; done
for i in $(seq 9 17); do just ci-row-clang $i; done

0 comments on commit c88b358

Please sign in to comment.