Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

add matrix in workflow build #11

add matrix in workflow build

add matrix in workflow build #11

Workflow file for this run

name: cmake
env:
FORCE_COLOR: 1
CLICOLOR_FORCE: 1
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
# Check latest clang
linux_clang_latest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- name: Install
run: |
sudo apt-get update
sudo apt-get install -y valgrind
sudo apt-get install -y lsb-release software-properties-common gnupg
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh
CLANG_PATH=$(ls /usr/bin/clang* | grep "clang-[0-9]" | sort --version-sort | tail -1)
CLANGPP_PATH=$(ls /usr/bin/clang* | grep "clang++-[0-9]" | sort --version-sort | tail -1)
echo "Latest Clang: $CLANG_PATH"
echo "Latest Clang++: $CLANGPP_PATH"
echo "CC=$CLANG_PATH" >> $GITHUB_ENV
echo "CXX=$CLANGPP_PATH" >> $GITHUB_ENV
- name: Build
shell: bash
run: |
python3 -m pip install .
# Check latest gcc
linux_gcc_latest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- name: Install
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
GCC_VERSION=$(apt search ^gcc-[0-9]*$ 2>/dev/null | grep -Po 'gcc-(\d+)(?=/)' | sort --version-sort | tail -1)
GPP_VERSION=$(apt search ^g\+\+-[0-9]*$ 2>/dev/null | grep -Po 'g\+\+-(\d+)(?=/)' | sort --version-sort | tail -1)
echo "Latest GCC: $GCC_VERSION"
echo "Latest G++: $GPP_VERSION"
sudo apt-get install -y $GCC_VERSION $GPP_VERSION
sudo apt-get install -y valgrind
echo "CC=$GCC_VERSION" >> $GITHUB_ENV
echo "CXX=$GPP_VERSION" >> $GITHUB_ENV
- name: Build
shell: bash
run: |
python3 -m pip install .
# Check macOS clang
macos_clang:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- name: Build and Test
run: |
pip install .
# Check Windows MSVC
windows_msvc:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
- name: Build and Test
run: |
python -m pip install .