C++: Updated constructor generation and allocator handling for unions… #252
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test and release CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - '*.preview' | |
| pull_request: | |
| branches: | |
| - main | |
| - '*.preview' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/opencyphal/toxic:tx22.4.3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: lint | |
| run: tox -e lint | |
| - name: test-nnvg | |
| run: tox -e py311-nnvg | |
| - name: test-doctest | |
| run: tox -e py311-doctest,py311-rstdoctest | |
| - name: test-pytest | |
| run: tox -e py311-test | |
| - name: test-report | |
| run: tox -e report | |
| - name: package | |
| run: tox -e package | |
| - name: upload-coverage-reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-reports | |
| path: .tox/report/tmp/* | |
| - name: upload-xunit-results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: xunit-results | |
| path: .tox/py311-test/tmp/xunit-result.xml | |
| - name: upload-package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pypi-package | |
| path: .tox/package/dist/* | |
| sonar: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # Disabling shallow clone is recommended for improving relevancy of reporting | |
| fetch-depth: 0 | |
| - name: download-coverage-reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-reports | |
| path: .tox/report/tmp/ | |
| - name: download-xunit-results | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: xunit-results | |
| path: .tox/py311-test/tmp/ | |
| - name: set-environment | |
| run: | | |
| echo NUNAVUT_MAJOR_MINOR_VERSION=$(./src/nunavut/_version.py --major-minor-only) >> $GITHUB_ENV | |
| - name: verify tox artifacts | |
| run: ls -R | |
| working-directory: .tox | |
| - name: report-release | |
| if: ${{ github.event_name != 'pull_request' }} | |
| uses: SonarSource/sonarqube-scan-action@v4.2.1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} | |
| with: | |
| args: > | |
| -Dsonar.token=${{ env.SONAR_TOKEN }} | |
| -Dsonar.buildString=${{ env.GITHUB_RUN_ID }} | |
| -Dsonar.projectVersion=${{ env.NUNAVUT_MAJOR_MINOR_VERSION }} | |
| -Dsonar.python.version=python3.11 | |
| -Dsonar.python.coverage.reportPaths=.tox/report/tmp/coverage.xml | |
| -Dsonar.python.xunit.reportPath=.tox/py311-test/tmp/xunit-result.xml | |
| - name: report-pr | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: SonarSource/sonarqube-scan-action@v4.2.1 | |
| env: | |
| SONAR_TOKEN: "6526e88c286672a7852fea52056c4b6ea583aaf7" | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| args: > | |
| -Dsonar.token=${{ env.SONAR_TOKEN }} | |
| -Dsonar.buildString=${{ env.GITHUB_RUN_ID }} | |
| -Dsonar.projectVersion=${{ env.NUNAVUT_MAJOR_MINOR_VERSION }} | |
| -Dsonar.python.version=python3.11 | |
| -Dsonar.python.coverage.reportPaths=.tox/report/tmp/coverage.xml | |
| -Dsonar.python.xunit.reportPath=.tox/py311-test/tmp/xunit-result.xml | |
| compat-test-python3-windows-and-mac: | |
| strategy: | |
| matrix: | |
| python3-version: ['11', '12', '13'] | |
| python3-platform: ['windows-latest', 'macos-latest'] | |
| runs-on: ${{ matrix.python3-platform }} | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.${{ matrix.python3-version }} | |
| - name: setup tox | |
| run: pip3 install tox | |
| - name: python3.${{ matrix.python3-version }} test | |
| run: tox -e py3${{ matrix.python3-version }}-nnvg,py3${{ matrix.python3-version }}-test | |
| compat-test-python3-ubuntu: | |
| strategy: | |
| matrix: | |
| python3-version: ['8', '9', '10', '11', '12', '13'] | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/opencyphal/toxic:tx22.4.3 | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: python3.${{ matrix.python3-version }} test | |
| run: tox -e py3${{ matrix.python3-version }}-nnvg,py3${{ matrix.python3-version }}-test | |
| language-verification-c-cpp: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| container: ghcr.io/opencyphal/toolshed:ts24.4.3 | |
| strategy: | |
| matrix: | |
| architecture: [native32, native, arm-none-eabi] | |
| compiler: [gcc, clang] | |
| language: [c-11, c-11-arr-override, c-17, c-23, cpp-14, cetl-14-17, cpp-17, cpp-17-pmr, cpp-20, cpp-20-pmr] | |
| exclude: | |
| - architecture: native32 | |
| compiler: clang | |
| - architecture: arm-none-eabi | |
| compiler: clang | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: verify | |
| working-directory: verification | |
| run: cmake --workflow --preset workflow-${{ matrix.compiler }}-${{ matrix.architecture }}-${{ matrix.language }} | |
| language-verification-c-clang-native-extra: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| container: ghcr.io/opencyphal/toolshed:ts24.4.3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: verify | |
| working-directory: verification | |
| run: | | |
| cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS="--enable-override-variable-array-capacity;--embed-auditing-info" --preset configure-clang-native-c-11 | |
| cmake --build --preset build-DebugCov-clang-native-c-11 --target cov_all | |
| - name: upload-verification-coverage-reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: verification-c-coverage-reports | |
| path: verification/build/DebugCov/coverage/* | |
| language-verification-cpp-clang-native-extra: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| container: ghcr.io/opencyphal/toolshed:ts22.4.10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: verify | |
| working-directory: verification | |
| run: | | |
| cmake -DNUNAVUT_EXTRA_GENERATOR_ARGS="--enable-override-variable-array-capacity;--embed-auditing-info" --preset configure-clang-native-cpp-20 | |
| cmake --build --preset build-DebugCov-clang-native-cpp-20 --target cov_all | |
| - name: upload-verification-coverage-reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: verification-cpp-coverage-reports | |
| path: verification/build/DebugCov/coverage/* | |
| language-verification-python: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| container: ghcr.io/opencyphal/toxic:tx22.4.3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: verify | |
| run: | | |
| cd verification/python | |
| nox | |
| env: | |
| FORCE_COLOR: 1 | |
| continue-on-error: true |