Skip to content

Commit

Permalink
Add additional compiler versions
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Jul 27, 2023
1 parent 2305838 commit ed855d1
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 58 deletions.
99 changes: 42 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,36 +63,31 @@ jobs:

build-configs:
needs: build-linux
runs-on: ubuntu-20.04
runs-on: ${{ matrix.target.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
compiler:
- cc: gcc-7
cxx: g++-7
- cc: gcc-8
cxx: g++-8
- cc: gcc-9
cxx: g++-9
- cc: gcc-10
cxx: g++-10
- cc: gcc-11
cxx: g++-11
- cc: clang-8
cxx: clang++-8
- cc: clang-9
cxx: clang++-9
- cc: clang-10
cxx: clang++-10
- cc: clang-11
cxx: clang++-11
- cc: clang-12
cxx: clang++-12
target:
- { os: ubuntu-20.04, cc: gcc-7, cxx: g++-7 }
- { os: ubuntu-20.04, cc: gcc-8, cxx: g++-8 }
- { os: ubuntu-20.04, cc: gcc-9, cxx: g++-9 }
- { os: ubuntu-20.04, cc: gcc-10, cxx: g++-10 }
- { os: ubuntu-20.04, cc: gcc-11, cxx: g++-11 }
- { os: ubuntu-latest, cc: gcc-12, cxx: g++-12 }
- { os: ubuntu-latest, cc: gcc-13, cxx: g++-13 }
- { os: ubuntu-20.04, cc: clang-8, cxx: clang++-8 }
- { os: ubuntu-20.04, cc: clang-9, cxx: clang++-9 }
- { os: ubuntu-20.04, cc: clang-10, cxx: clang++-10 }
- { os: ubuntu-20.04, cc: clang-11, cxx: clang++-11 }
- { os: ubuntu-20.04, cc: clang-12, cxx: clang++-12 }
- { os: ubuntu-latest, cc: clang-13, cxx: clang++-13 }
- { os: ubuntu-latest, cc: clang-14, cxx: clang++-14 }
- { os: ubuntu-latest, cc: clang-15, cxx: clang++-15 }

env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
CC: ${{ matrix.target.cc }}
CXX: ${{ matrix.target.cxx }}

steps:
- uses: actions/checkout@v3
Expand All @@ -102,8 +97,8 @@ jobs:
- name: install compiler
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.compiler.cc }}
sudo apt-get install -y ${{ matrix.compiler.cxx }}
sudo apt-get install -y ${{ matrix.target.cc }}
sudo apt-get install -y ${{ matrix.target.cxx }}
- name: install bake
run: |
Expand All @@ -124,14 +119,12 @@ jobs:
bake examples/c --strict --cfg debug
bake examples/cpp --strict --cfg debug
bake examples/os_api --strict --cfg debug
bake examples/os_api/bake --strict --cfg debug
- name: build examples (release)
run: |
bake examples/c --strict --cfg release
bake examples/cpp --strict --cfg release
bake examples/os_api --strict --cfg release
bake examples/os_api/bake --strict --cfg release
build-configs-windows:
needs: [build-windows]
Expand Down Expand Up @@ -244,37 +237,29 @@ jobs:

test-cpp-unix:
needs: [build-linux]
runs-on: ubuntu-20.04
runs-on: ${{ matrix.target.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
compiler:
# Currently not supported for C++ API, as enum reflection doesn't work
# - cc: gcc-7
# cxx: g++-7
# - cc: gcc-8
# cxx: g++-8
- cc: gcc-9
cxx: g++-9
- cc: gcc-10
cxx: g++-10
- cc: gcc-11
cxx: g++-11
- cc: clang-8
cxx: clang++-8
- cc: clang-9
cxx: clang++-9
- cc: clang-10
cxx: clang++-10
- cc: clang-11
cxx: clang++-11
- cc: clang-12
cxx: clang++-12
target:
- { os: ubuntu-20.04, cc: gcc-9, cxx: g++-9 }
- { os: ubuntu-20.04, cc: gcc-10, cxx: g++-10 }
- { os: ubuntu-20.04, cc: gcc-11, cxx: g++-11 }
- { os: ubuntu-latest, cc: gcc-12, cxx: g++-12 }
- { os: ubuntu-latest, cc: gcc-13, cxx: g++-13 }
- { os: ubuntu-20.04, cc: clang-8, cxx: clang++-8 }
- { os: ubuntu-20.04, cc: clang-9, cxx: clang++-9 }
- { os: ubuntu-20.04, cc: clang-10, cxx: clang++-10 }
- { os: ubuntu-20.04, cc: clang-11, cxx: clang++-11 }
- { os: ubuntu-20.04, cc: clang-12, cxx: clang++-12 }
- { os: ubuntu-latest, cc: clang-13, cxx: clang++-13 }
- { os: ubuntu-latest, cc: clang-14, cxx: clang++-14 }
- { os: ubuntu-latest, cc: clang-15, cxx: clang++-15 }

env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
CC: ${{ matrix.target.cc }}
CXX: ${{ matrix.target.cxx }}

steps:
- uses: actions/checkout@v3
Expand All @@ -284,13 +269,13 @@ jobs:
- name: install compiler
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.compiler.cc }}
sudo apt-get install -y ${{ matrix.compiler.cxx }}
sudo apt-get install -y ${{ matrix.target.cc }}
sudo apt-get install -y ${{ matrix.target.cxx }}
- name: compiler version
run: |
${{ matrix.compiler.cc }} --version
${{ matrix.compiler.cxx }} --version
${{ matrix.target.cc }} --version
${{ matrix.target.cxx }} --version
- name: install bake
run: |
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/entities/iterate_components/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void iterate_components(flecs::entity e) {
std::cout << e.type().str() << "\n\n";

// 2. To get individual component ids, use entity::each
std::int32_t i = 0;
int32_t i = 0;
e.each([&](flecs::id id) {
std::cout << i++ << ": " << id.str() << "\n";
});
Expand Down
4 changes: 4 additions & 0 deletions flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ extern "C" {
/* Useful, but not reliable enough. It can incorrectly flag macro's as unused
* in standalone builds. */
#pragma clang diagnostic ignored "-Wunused-macros"
#if __clang_major__ == 13
/* clang 13 can throw this warning for a define in ctype.h */
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif
#elif defined(ECS_TARGET_GNU)
#ifndef __cplusplus
#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
Expand Down
4 changes: 4 additions & 0 deletions include/flecs/private/api_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
/* Useful, but not reliable enough. It can incorrectly flag macro's as unused
* in standalone builds. */
#pragma clang diagnostic ignored "-Wunused-macros"
#if __clang_major__ == 13
/* clang 13 can throw this warning for a define in ctype.h */
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif
#elif defined(ECS_TARGET_GNU)
#ifndef __cplusplus
#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
Expand Down

0 comments on commit ed855d1

Please sign in to comment.