Update c-cpp.yml #409
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: C/C++ CI | |
| on: | |
| push: | |
| branches: [ tests, function_feature, move_feature, future_feature ] | |
| pull_request: | |
| branches: [ tests, function_feature, move_feature, future_feature ] | |
| jobs: | |
| unix: | |
| #if: ${{ false }} # disable for now | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| TARGET: x86_64-apple-darwin | |
| COMPILER: clang | |
| LINKER: clang | |
| LIBRARY_PATH: $LIBRARY_PATH | |
| CPP_COMPILER: clang++ | |
| BUILD_LIB_SCRIPT: build_lib.sh | |
| BUILD_SCRIPT: build_tests.sh | |
| RUN_SCRIPT: run_tests.sh | |
| SETUP_SCRIPT: | | |
| cd ./stdex | |
| chmod a+rwx ./build_lib.sh | |
| cd .. | |
| chmod a+rwx ./build_tests.sh | |
| chmod a+rwx ./run_tests.sh | |
| - os: ubuntu-latest | |
| TARGET: armv7-unknown-linux-musleabihf | |
| COMPILER: arm-linux-gnueabihf-gcc-5 | |
| LINKER: gcc-5-arm-linux-gnueabihf | |
| LIBRARY_PATH: $LIBRARY_PATH | |
| CPP_COMPILER: g++ | |
| BUILD_LIB_SCRIPT: build_lib.sh | |
| BUILD_SCRIPT: build_tests.sh | |
| RUN_SCRIPT: run_tests.sh | |
| SETUP_SCRIPT: | | |
| cd ./stdex | |
| chmod a+rwx ./build_lib.sh | |
| cd .. | |
| chmod a+rwx ./build_tests.sh | |
| chmod a+rwx ./run_tests.sh | |
| - os: ubuntu-latest | |
| TARGET: x86_64-unknown-linux-musl | |
| COMPILER: gcc | |
| LINKER: gcc | |
| LIBRARY_PATH: $LIBRARY_PATH | |
| CPP_COMPILER: g++ | |
| BUILD_LIB_SCRIPT: build_lib.sh | |
| BUILD_SCRIPT: build_tests.sh | |
| RUN_SCRIPT: run_tests.sh | |
| SETUP_SCRIPT: | | |
| cd ./stdex | |
| chmod a+rwx ./build_lib.sh | |
| cd .. | |
| chmod a+rwx ./build_tests.sh | |
| chmod a+rwx ./run_tests.sh | |
| - os: ubuntu-22.04 | |
| COMPILER: gcc | |
| LINKER: gcc | |
| CPP_COMPILER: g++-3.4 | |
| LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:$LIBRARY_PATH | |
| BUILD_LIB_SCRIPT: build_lib.sh | |
| BUILD_SCRIPT: build_tests.sh | |
| RUN_SCRIPT: run_tests.sh | |
| SETUP_SCRIPT: | | |
| echo "deb [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy universe" | sudo tee -a /etc/apt/sources.list | |
| echo "deb-src [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy universe" | sudo tee -a /etc/apt/sources.list | |
| #echo "deb http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main" | sudo tee -a /etc/apt/sources.list | |
| #echo "deb-src http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main" | sudo tee -a /etc/apt/sources.list | |
| #echo "deb http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main" | sudo tee -a /etc/apt/sources.list | |
| #echo "deb-src http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main" | sudo tee -a /etc/apt/sources.list | |
| sudo apt-get update | |
| sudo -E apt-get -yq --no-install-suggests --no-install-recommends install gcc-3.4 g++-3.4 gcc-multilib g++-multilib | |
| dpkg --list | grep compiler | |
| sudo /sbin/ldconfig -p | grep libgcc | |
| sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1 | |
| cd ./stdex | |
| chmod a+rwx ./build_lib.sh | |
| cd .. | |
| chmod a+rwx ./build_tests.sh | |
| chmod a+rwx ./run_tests.sh | |
| - os: ubuntu-22.04 | |
| COMPILER: gcc | |
| LINKER: gcc | |
| CPP_COMPILER: g++-4.4 | |
| LIBRARY_PATH: $LIBRARY_PATH | |
| BUILD_LIB_SCRIPT: build_lib.sh | |
| BUILD_SCRIPT: build_tests.sh | |
| RUN_SCRIPT: run_tests.sh | |
| SETUP_SCRIPT: | | |
| sudo gpg --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 | |
| sudo gpg --export --armor 40976EAF437D05B5 | sudo apt-key add - | |
| sudo gpg --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 | |
| sudo gpg --export --armor 3B4FE6ACC0B21F32 | sudo apt-key add - | |
| echo "deb [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy universe" | sudo tee -a /etc/apt/sources.list | |
| echo "deb-src [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy universe" | sudo tee -a /etc/apt/sources.list | |
| echo "deb [trusted=yes] http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main" | sudo tee -a /etc/apt/sources.list | |
| echo "deb-src [trusted=yes] http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main" | sudo tee -a /etc/apt/sources.list | |
| echo "deb [trusted=yes] http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main" | sudo tee -a /etc/apt/sources.list | |
| echo "deb-src [trusted=yes] http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main" | sudo tee -a /etc/apt/sources.list | |
| sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" | |
| sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty main' | |
| sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ trusty universe' | |
| sudo apt-get update | |
| sudo -E apt-get -yq --no-install-suggests --no-install-recommends install g++-4.4 | |
| dpkg --list | grep compiler | |
| #sudo /sbin/ldconfig -p | grep libgcc | |
| #sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1 | |
| cd ./stdex | |
| chmod a+rwx ./build_lib.sh | |
| cd .. | |
| chmod a+rwx ./build_tests.sh | |
| chmod a+rwx ./run_tests.sh | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: setup enviroment | |
| run: ${{matrix.SETUP_SCRIPT}} | |
| - name: build lib | |
| env: | |
| COMPILER: ${{ matrix.CPP_COMPILER }} | |
| LIBRARY_PATH: ${{ matrix.LIBRARY_PATH }} | |
| run: | | |
| cd ./stdex | |
| ./${{ matrix.BUILD_LIB_SCRIPT }} | |
| cd .. | |
| - name: build tests | |
| env: | |
| COMPILER: ${{ matrix.CPP_COMPILER }} | |
| LIBRARY_PATH: ${{ matrix.LIBRARY_PATH }} | |
| run: | | |
| ./${{ matrix.BUILD_SCRIPT }} | |
| - name: run tests | |
| run: | | |
| ./${{ matrix.RUN_SCRIPT }} | |
| ./tests/bin/thread_tests& | |
| echo "waiting for process to start" | |
| proc_number=$(ps aux | grep -v grep | grep -ci "thread_tests") | |
| while [ "$proc_number" -lt 1 ]; | |
| do | |
| proc_number=$(ps aux | grep -v grep | grep -ci "thread_tests") | |
| sleep 0.01 | |
| done | |
| thread_tests_pid=$! | |
| echo "process started $thread_tests_pid - shifting time" | |
| current_time=$(date +%H%M) | |
| lcount=330 | |
| while [ "$proc_number" -gt 0 ]; | |
| do | |
| proc_number=$(ps aux | grep -v grep | grep -ci "thread_tests" || true) | |
| minutes=59 | |
| begin=0 | |
| end=100 | |
| if [ "$lcount" -lt 10 ]; then | |
| echo "timeout..." | |
| break | |
| fi | |
| lcount=$((lcount-1)) | |
| while [ $begin -lt $end ]; do | |
| if [ "$minutes" -lt 11 ]; then | |
| minutes=59 | |
| fi | |
| begin=$((begin+1)) | |
| minutes=$((minutes-1)) | |
| curr=$(date +%d/%m/%Y-%H:%M:%S) | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo date -s 08$minutes >> /dev/null | |
| else | |
| sudo date 08$minutes >> /dev/null | |
| fi | |
| sleep 0.01 | |
| : | |
| done | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo date -s $current_time >> /dev/null | |
| else | |
| sudo date $current_time >> /dev/null | |
| fi | |
| done | |
| thread_tests_ec=$(wait $thread_tests_pid) | |
| echo thread_tests ret code: | |
| echo "$thread_tests_ec" | |
| exit $thread_tests_ec | |
| windows: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-2019 | |
| COMPILER: cl | |
| LINKER: ilink | |
| CPP_COMPILER: cl | |
| LIBRARY_PATH: "" | |
| BUILD_LIB_SCRIPT: ~build_lib.bat | |
| BUILD_SCRIPT: ~build_tests.bat | |
| RUN_SCRIPT: run_tests.bat | |
| SETUP_SCRIPT: | | |
| if exist "C:\PROGRA~1\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" ( | |
| set MSVS_VSVARS_PATH="C:\PROGRA~1\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" | |
| ) else if exist "C:\PROGRA~2\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" ( | |
| set MSVS_VSVARS_PATH="C:\PROGRA~2\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" | |
| ) else ( | |
| echo "cannot find %MSVS_VSVARS_PATH%" | |
| exit /B 1 | |
| ) | |
| echo %MSVS_VSVARS_PATH% | |
| cd .\\stdex | |
| echo call %MSVS_VSVARS_PATH% > ~build_lib.bat | |
| cat build_lib.bat >> ~build_lib.bat | |
| cd .. | |
| echo call %MSVS_VSVARS_PATH% > ~build_tests.bat | |
| cat build_tests.bat >> ~build_tests.bat | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: setup enviroment | |
| run: | | |
| git submodule update --init --recursive | |
| ${{matrix.SETUP_SCRIPT}} | |
| shell: cmd | |
| - name: build lib | |
| env: | |
| COMPILER: ${{ matrix.CPP_COMPILER }} | |
| LIBRARY_PATH: ${{ matrix.LIBRARY_PATH }} | |
| run: | | |
| cd .\\stdex | |
| ${{ matrix.BUILD_LIB_SCRIPT }} | |
| cd .. | |
| shell: cmd | |
| - name: build tests | |
| env: | |
| COMPILER: ${{ matrix.CPP_COMPILER }} | |
| LIBRARY_PATH: ${{ matrix.LIBRARY_PATH }} | |
| run: | | |
| ${{ matrix.BUILD_SCRIPT }} | |
| shell: cmd | |
| - name: run tests | |
| run: | | |
| ${{ matrix.RUN_SCRIPT }} | |
| shell: cmd |