Skip to content

Commit

Permalink
ci: test all c++ versions
Browse files Browse the repository at this point in the history
Clarify that we are using clang
Cleanup CI
Add more macos versions
  • Loading branch information
iMichka committed Feb 19, 2025
1 parent e6f4b19 commit 35a2d2b
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 35 deletions.
112 changes: 78 additions & 34 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
tests:
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.version }}-python-${{ matrix.python-version }}-${{ matrix.castxml-epic }}
name: ${{ matrix.os }} ${{ matrix.compiler }}${{ matrix.clang-version }} ${{ matrix.cppstd }} Python ${{ matrix.python-version }} Epic ${{ matrix.castxml-epic }}
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -16,87 +16,124 @@ jobs:
include:
# UBUNTU 22.04 - CASTXML EPIC 0
- os: ubuntu-22.04
compiler: gcc
version: "11"
compiler: clang++
clang-version: 13
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-22.04
compiler: clang++
clang-version: 14
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-22.04
compiler: clang++
clang-version: 15
python-version: "3.13"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-22.04
compiler: gcc
version: "11"
compiler: clang++
clang-version: 15
python-version: "3.13"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++98"

# UBUNTU 24.04 - CASTXML EPIC 0
- os: ubuntu-24.04
compiler: gcc
version: "13"
compiler: clang++
clang-version: 16
python-version: "3.9"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-24.04
compiler: gcc
version: "13"
compiler: clang++
clang-version: 16
python-version: "3.10"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-24.04
compiler: gcc
version: "13"
compiler: clang++
clang-version: 16
python-version: "3.11"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-24.04
compiler: gcc
version: "13"
compiler: clang++
clang-version: 16
python-version: "3.12"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++98"

- os: ubuntu-24.04
compiler: gcc
version: "13"
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++98"

# UBUNTU 24.04 - CASTXML EPIC 0 - c++XX
- os: ubuntu-24.04
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++11"

- os: ubuntu-24.04
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++14"

- os: ubuntu-24.04
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++17"

# UBUNTU 24.04 - CASTXML EPIC 1
- os: ubuntu-24.04
compiler: gcc
version: "13"
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++98"

- os: ubuntu-24.04
compiler: gcc
version: "13"
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml: "castxml"
castxml-epic: 1
cppstd: "-std=c++11"

# MACOS
- os: macos-13
compiler: xcode
version: "default"
compiler: clang++
python-version: "3.13"
castxml: "castxml"
castxml-epic: 0
cppstd: "-std=c++98"
cppstd: "-std=c++11"

- os: macos-14
compiler: clang++
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++14"

- os: macos-15
compiler: clang++
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++17"

steps:
- uses: actions/checkout@v4
Expand All @@ -116,12 +153,19 @@ jobs:
- name: Run pycodestyle
run: pycodestyle . --exclude=docs

- name: Write xml_generator.cfg
if: contains(matrix.os, 'ubuntu')
run: |
echo "[xml_generator]" > tests/xml_generator.cfg
echo "compiler_path=/usr/bin/${{ matrix.compiler }}-${{ matrix.clang-version }}" >> tests/xml_generator.cfg
echo "ccflags=${{ matrix.cppstd }}" >> tests/xml_generator.cfg
- name: Setup castxml for Linux
if: contains(matrix.os, 'ubuntu') && matrix.castxml == 'castxml'
if: contains(matrix.os, 'ubuntu')
run: |
wget -q -O - https://data.kitware.com/api/v1/file/hashsum/sha512/bdbb67a10c5f8d1b738cd19cb074f409d4803e8077cb8c1072ef4eaf738fa871a73643f9c8282d58cae28d188df842c82ad6620b6d590b0396a0172a27438dce/download | tar zxf - -C ~/
- name: Setup castxml for Mac
if: matrix.os == 'macos-13'
if: contains(matrix.os, 'macos')
run: |
wget -q -O - https://data.kitware.com/api/v1/file/hashsum/sha512/5d937e938f7b882a3a3e7941e68f8312d0898aaf2082e00003dd362b1ba70b98b0a08706a1be28e71652a6a0f1e66f89768b5eaa20e5a100592d5b3deefec3f0/download | tar zxf - -C ~/
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion src/pygccxml/parser/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def load_xml_generator_configuration(configuration, **defaults):
An example configuration file skeleton can be found
`here <https://github.com/gccxml/pygccxml/blob/develop/
unittests/xml_generator.cfg>`_.
tests/xml_generator.cfg>`_.
"""
parser = configuration
Expand Down
17 changes: 17 additions & 0 deletions tests/xml_generator.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[xml_generator]
# Specify which xml generator you want to use "castxml" or "gccxml"
# "castxml is the default"
xml_generator=
# Path to castxml or gccxml executable file
xml_generator_path=
# Set the path to the compiler (for example "/usr/bin/gcc") for CastXML
compiler_path=
# Gccxml working directory - optional, could be set to your source code directory
working_directory=
# Additional include directories, as list of paths ["path1/file1.h", "path2/file2.h", ...]
include_paths=
# You can explicitly set what compiler it should emulate (for GCCXML)
# Valid options are: g++, msvc6, msvc7, msvc71, msvc8, cl.
compiler=
# Keep xml files after errors (useful for debugging)
keep_xml=

0 comments on commit 35a2d2b

Please sign in to comment.