From 3b85d48cf1051fe30783f439352d4f990ae05cce Mon Sep 17 00:00:00 2001 From: Daniel Greenstein Date: Mon, 22 Aug 2022 00:39:52 +0100 Subject: [PATCH 1/3] adding aswf ci yaml file --- .github/workflows/ci.yml | 480 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 480 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..628f081 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,480 @@ +# borrowed this from: +# https://raw.githubusercontent.com/AcademySoftwareFoundation/Imath/main/.github/workflows/ci_workflow.yml +# with some slight simplification + +name: CI + +on: + push: + # Jobs are skipped when ONLY Markdown (*.md) files are changed + paths-ignore: + - '**.md' + pull_request: + paths-ignore: + - '**.md' + +jobs: + # Linux jobs run in Docker containers, so the latest OS version is OK. macOS + # and Windows jobs need to be locked to specific virtual environment + # versions to mitigate issues from OS updates, and will require maintenance + # as OS versions are retired. + # + # GH Actions (Free plan) supports 20 concurrent jobs, with 5 concurrent macOS + # jobs. This workflow tries to utilize (but not exceed) that budget to + # promote timely CI. + + # --------------------------------------------------------------------------- + # Linux + # --------------------------------------------------------------------------- + # TODO: Add ARM build. Add sanitize build. + + linux: + name: 'Linux CentOS 7 VFX CY${{ matrix.vfx-cy }} + <${{ matrix.compiler-desc }} , + config=${{ matrix.build-type }}, + shared=${{ matrix.build-shared }}, + cxx=${{ matrix.cxx-standard }}>' + # GH-hosted VM. The build runs in CentOS 7 'container' defined below. + runs-on: ubuntu-latest + container: + # DockerHub: https://hub.docker.com/u/aswf + # Source: https://github.com/AcademySoftwareFoundation/aswf-docker + image: aswf/ci-openexr:${{ matrix.vfx-cy }} + strategy: + matrix: + build: [1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15, 20, 21, 22] + include: + # ------------------------------------------------------------------- + # GCC, VFX CY2022 + # ------------------------------------------------------------------- + # C++17, Python 3.9 + - build: 1 + build-type: Release + build-shared: 'ON' + cxx-standard: 17 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc9.3.1 + vfx-cy: 2022 + + # C++17, Python 3.9.7, Debug + - build: 2 + build-type: Debug + build-shared: 'ON' + cxx-standard: 17 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc9.3.1 + vfx-cy: 2022 + + # C++17, Python 3.9.7, Static + - build: 3 + build-type: Release + build-shared: 'OFF' + cxx-standard: 17 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc9.3.1 + vfx-cy: 2022 + + # C++14, Python 3.9.7, Static + - build: 4 + build-type: Release + build-shared: 'ON' + cxx-standard: 14 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc9.3.1 + vfx-cy: 2022 + + # C++17, no Python + # - build: 5 + # build-type: Release + # build-shared: 'ON' + # cxx-standard: 17 + # cxx-compiler: g++ + # cc-compiler: gcc + # compiler-desc: gcc9.3.1 + # python: 'OFF' + # python-desc: no python + # vfx-cy: 2022 + + # ------------------------------------------------------------------- + # GCC, VFX CY2021 + # ------------------------------------------------------------------- + # C++17, Python 3.7.9 + - build: 9 + build-type: Release + build-shared: 'ON' + cxx-standard: 17 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc9.3.1 + python: 'ON' + vfx-cy: 2021 + + # ------------------------------------------------------------------- + # GCC, VFX CY2020 + # ------------------------------------------------------------------- + # C++14, Python 3.7 + - build: 10 + build-type: Release + build-shared: 'ON' + cxx-standard: 14 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc6.3.1 + vfx-cy: 2020 + + # ------------------------------------------------------------------- + # GCC, VFX CY2019 + # ------------------------------------------------------------------- + # C++11, Python 2.7 + - build: 11 + build-type: Release + build-shared: 'ON' + cxx-standard: 11 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: gcc6.3.1 + vfx-cy: 2019 + + # ------------------------------------------------------------------- + # Clang, VFX CY2022 + # ------------------------------------------------------------------- + # C++17, Python 3.9 + - build: 12 + build-type: Release + build-shared: 'ON' + cxx-standard: 17 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang10.4 + vfx-cy: 2022 + + # C++17, Python 3.9.7, Debug + - build: 13 + build-type: Debug + build-shared: 'ON' + cxx-standard: 17 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang10.4 + vfx-cy: 2022 + + # C++17, Python 3.9.7, Static + - build: 14 + build-type: Release + build-shared: 'OFF' + cxx-standard: 17 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang10.4 + vfx-cy: 2022 + + # C++14, Python 3.9.7, Static + - build: 15 + build-type: Release + build-shared: 'ON' + cxx-standard: 14 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang10.4 + vfx-cy: 2022 + + # ------------------------------------------------------------------- + # Clang, VFX CY2021 + # ------------------------------------------------------------------- + # C++17, Python 3.7.9 + - build: 20 + build-type: Release + build-shared: 'ON' + cxx-standard: 17 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang10.4 + vfx-cy: 2021 + + # ------------------------------------------------------------------- + # Clang, VFX CY2020 + # ------------------------------------------------------------------- + # C++14, Python 3.7 + - build: 21 + build-type: Release + build-shared: 'ON' + cxx-standard: 14 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang7.8 + vfx-cy: 2020 + + # ------------------------------------------------------------------- + # Clang, VFX CY2019 + # ------------------------------------------------------------------- + # C++11, Python 2.7 + - build: 22 + build-type: Release + build-shared: 'ON' + cxx-standard: 11 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: clang7.8 + vfx-cy: 2019 + + env: + CXX: ${{ matrix.cxx-compiler }} + CC: ${{ matrix.cc-compiler }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Create build directories + run: | + mkdir _install + mkdir _build + - name: Configure + run: | + cmake .. \ + -DCMAKE_INSTALL_PREFIX=../_install \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ + -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ + -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ + -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \ + working-directory: _build + - name: Build + run: | + cmake --build . \ + --target install \ + --config ${{ matrix.build-type }} + working-directory: _build + - name: Test + run: | + ctest -C ${{ matrix.build_type }} + working-directory: _build + + # --------------------------------------------------------------------------- + # macOS + # --------------------------------------------------------------------------- + + macos_no_python: + name: 'macOS 10.15 + ' + runs-on: macos-10.15 + strategy: + matrix: + build: [1, 2, 3, 4, 5] + include: + # C++11 + - build: 1 + build-type: Release + build-shared: 'ON' + build-docs: 'ON' + cxx-standard: 17 + exclude-tests: + + # Debug + - build: 2 + build-type: Debug + build-shared: 'ON' + build-docs: 'OFF' + cxx-standard: 17 + exclude-tests: + + # Static + - build: 3 + build-type: Debug + build-shared: 'OFF' + build-docs: 'OFF' + cxx-standard: 17 + exclude-tests: + + # C++14 + - build: 4 + build-type: Release + build-shared: 'ON' + build-docs: 'OFF' + cxx-standard: 14 + exclude-tests: + + # C++11 + - build: 5 + build-type: Release + build-shared: 'ON' + build-docs: 'OFF' + cxx-standard: 11 + exclude-tests: + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Create build directories + run: | + mkdir _install + mkdir _build + + - name: Configure + run: | + cmake ../. \ + -DCMAKE_INSTALL_PREFIX=../_install \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ + -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ + -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ + -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} + working-directory: _build + - name: Build + run: | + cmake --build . \ + --target install \ + --config ${{ matrix.build-type }} \ + -- -j2 + working-directory: _build + - name: Test + run: | + ctest -C ${{ matrix.build_type }} + working-directory: _build + + # --------------------------------------------------------------------------- + # Windows + # --------------------------------------------------------------------------- + + windows: + name: 'Windows 2019 + <${{ matrix.compiler-desc }}, + config=${{ matrix.build-type }}, + shared=${{ matrix.build-shared }}, + cxx=${{ matrix.cxx-standard }}, + docs=${{ matrix.build-docs }}>' + runs-on: windows-${{ matrix.osver }} + strategy: + matrix: + build: [1, 3, 4, 6, 7, 8] + include: + # ------------------------------------------------------------------- + # VFX CY2022 - C++17 - Windows 2019 + # ------------------------------------------------------------------- + # C++17, Release Shared + - build: 1 + build-type: Release + build-shared: 'ON' + build-docs: 'ON' + compiler-desc: msvc16.11 + cxx-standard: 17 + vfx-cy: 2022 + exclude-tests: + osver: 2019 + + # C++17, Debug - + ## - build: 2 + ## build-type: Debug + ## build-shared: 'ON' + ## build-docs: 'OFF' + ## cxx-standard: 17 + ## exclude-tests: + + # C++17, Release Static + - build: 3 + build-type: Release + build-shared: 'OFF' + build-docs: 'OFF' + compiler-desc: msvc16.11 + cxx-standard: 17 + vfx-cy: 2022 + exclude-tests: + osver: 2019 + + # ------------------------------------------------------------------- + # VFX CY2022 - C++17 - Windows 2022 + # ------------------------------------------------------------------- + # C++17, Release Shared + - build: 4 + build-type: Release + build-shared: 'ON' + build-docs: 'ON' + compiler-desc: msvc17.1 + cxx-standard: 17 + vfx-cy: 2022 + exclude-tests: + osver: 2022 + + # C++17, Debug - + ## - build: 5 + ## build-type: Debug + ## build-shared: 'ON' + ## build-docs: 'OFF' + ## cxx-standard: 17 + ## exclude-tests: + + # C++17, Release Static + - build: 6 + build-type: Release + build-shared: 'OFF' + build-docs: 'OFF' + compiler-desc: msvc17.1 + cxx-standard: 17 + vfx-cy: 2022 + exclude-tests: + osver: 2022 + + # ------------------------------------------------------------------- + # VFX CY2020 - C++14 - Windows 2019 + # ------------------------------------------------------------------- + # C++14, Release Shared + - build: 7 + build-type: Release + build-shared: 'ON' + build-docs: 'OFF' + compiler-desc: msvc16.11 + cxx-standard: 14 + vfx-cy: 2020 + exclude-tests: + osver: 2019 + + # ------------------------------------------------------------------- + # VFX CY2019 - C++11 - Windows 2019 + # ------------------------------------------------------------------- + # C++11, Release Shared + - build: 8 + build-type: Release + build-shared: 'ON' + build-docs: 'OFF' + compiler-desc: msvc16.11 + cxx-standard: 11 + exclude-tests: + osver: 2019 + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Create build directories + run: | + mkdir _install + mkdir _build + shell: bash + - name: Configure + run: | + cmake ../. \ + -DCMAKE_INSTALL_PREFIX=../_install \ + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS='ON'\ + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ + -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \ + -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \ + -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} + shell: bash + working-directory: _build + - name: Build + run: | + cmake --build . \ + --target install \ + --config ${{ matrix.build-type }} + shell: bash + working-directory: _build + - name: Test + run: | + ctest -C Release + shell: bash + working-directory: _build \ No newline at end of file From e7b4ab950a94954c998df0300a245cedce9418fe Mon Sep 17 00:00:00 2001 From: Daniel Greenstein Date: Mon, 22 Aug 2022 00:44:57 +0100 Subject: [PATCH 2/3] trying out dynamic build type again --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 628f081..51c96f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -475,6 +475,6 @@ jobs: working-directory: _build - name: Test run: | - ctest -C Release + ctest -C ${{ matrix.build-type }} shell: bash working-directory: _build \ No newline at end of file From 87f735237b618515ec48204936e3e87a0d30b01b Mon Sep 17 00:00:00 2001 From: Daniel Greenstein Date: Mon, 22 Aug 2022 00:47:39 +0100 Subject: [PATCH 3/3] additional comment for future self --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51c96f6..868ffd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -455,6 +455,7 @@ jobs: mkdir _build shell: bash - name: Configure + # the windows build needs the -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to work run: | cmake ../. \ -DCMAKE_INSTALL_PREFIX=../_install \