Skip to content

tests.yml

tests.yml #616

Workflow file for this run

on:
push:
branches:
- main
- develop
pull_request:
jobs:
tests:
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.version }}-python-${{ matrix.python-version }}-${{ matrix.castxml-epic }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04
compiler: gcc
version: "11"
python-version: "3.11"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++17"
- os: ubuntu-22.04
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++11"
- os: ubuntu-22.04-arm64
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04-arm64
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04-arm64
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04-arm64
compiler: gcc
version: "11"
python-version: "3.11"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-22.04-arm64
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++17"
- os: ubuntu-22.04-arm64
compiler: gcc
version: "11"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++11"
- os: ubuntu-24.04-arm64
compiler: gcc
version: "14"
python-version: "3.12"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-24.04-arm64
compiler: gcc
version: "14"
python-version: "3.12"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-24.04-arm64
compiler: gcc
version: "14"
python-version: "3.12"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-24.04-arm64
compiler: gcc
version: "14"
python-version: "3.12"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-24.04-arm64
compiler: gcc
version: "14"
python-version: "3.12"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: ubuntu-24.04-arm64
compiler: gcc
version: "14"
python-version: "3.12"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++17"
- os: ubuntu-24.04-arm64
compiler: gcc
version: "14"
pyton-version: "3.12"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++17"
- os: macos-13
compiler: xcode
version: "default"
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
- os: macos-15
compiler: xcode
version: "default"
python-version: "3.12"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++17"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install Python lib and test libs
run: pip install '.[test]'
- name: Run pycodestyle
run: pycodestyle . --exclude=docs
- name: Setup CastXML
run: |
echo "Downloading CastXML from ${{ matrix.castxml_url }}..."
wget -q "${{ matrix.castxml_url }}" -O "${{ matrix.castxml_filename }}"
echo "Unzipping ${{ matrix.castxml_filename }}..."
unzip -q "${{ matrix.castxml_filename }}" -d ~/
if [ ! -f ~/"${{ matrix.castxml_tar_filename }}" ]; then
echo "Error: Inner tar.gz archive '${{ matrix.castxml_tar_filename }}' not found!"
exit 1
fi
echo "Extracting ~/${{ matrix.castxml_tar_filename }} to ~/castxml_install..."
mkdir -p ~/castxml_install
tar -xzf ~/"${{ matrix.castxml_tar_filename }}" -C ~/castxml_install
# --- Windows-specific handling ---
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
if [ ! -f ~/castxml_install/castxml.exe ]; then
echo "Error: castxml.exe binary not found in ~/castxml_install!"
exit 1
fi
echo "Adding ~/castxml_install to PATH..."
echo "$HOME/castxml_install" >> $GITHUB_PATH
else
# --- Handling for non-Windows platforms ---
if [ ! -f ~/castxml_install/castxml ]; then
echo "Error: castxml binary not found in ~/castxml_install!"
exit 1
fi
chmod +x ~/castxml_install/castxml
echo "Adding ~/castxml_install to PATH..."
echo "$HOME/castxml_install" >> $GITHUB_PATH
fi
- name: Run tests
run: |
echo "Using castxml at: $(which castxml)"
castxml --version
pytest tests