Merge pull request #7361 from xaerru/fix-deepcopy #1
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: LSP (can fail) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: 14.0 | |
| jobs: | |
| test_lsp: | |
| name: LSP Tests (${{ matrix.python-version }}, ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["macos-latest", "ubuntu-latest"] | |
| python-version: ["3.10"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: mamba-org/[email protected] | |
| with: | |
| micromamba-version: '2.0.4-0' | |
| environment-file: ci/environment.yml | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| - name: Install Linux / macOS Packages | |
| if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') | |
| shell: bash -e -l {0} | |
| run: micromamba install bison=3.4 | |
| - uses: hendrikmuhs/ccache-action@main | |
| with: | |
| key: ${{ github.job }}-${{ matrix.os }} | |
| - name: Setup Platform | |
| shell: bash -e -l {0} | |
| run: | | |
| echo "LFORTRAN_CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV | |
| echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV | |
| echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV | |
| echo "ENABLE_RUNTIME_STACKTRACE=yes" >> $GITHUB_ENV | |
| - name: Build (Linux / macOS) | |
| shell: bash -e -l {0} | |
| if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') | |
| run: | | |
| export CXXFLAGS="-Werror" | |
| export CFLAGS="-Werror" | |
| xonsh ci/build_tmp.xsh | |
| - name: Install Timeout (macOS) | |
| shell: bash -e -l {0} | |
| if: contains(matrix.os, 'macos') | |
| run: brew install coreutils | |
| # ~/.bash_logout wanted to run `/usr/bin/clear_console -q` while exiting | |
| # login shells which frequently erred on ubuntu-latest since the shell was | |
| # not run interactively. | |
| - name: Disable ~/.bash_logout (Linux) | |
| shell: bash -e {0} | |
| if: contains(matrix.os, 'ubuntu') | |
| run: mv -v ~/.bash_logout ~/.bash_logout.bak | |
| - name: Test (Linux / macOS) | |
| shell: bash -e -l {0} | |
| if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') | |
| timeout-minutes: 5 | |
| env: | |
| EXIT_SUCCESS: 0 | |
| EXIT_TIMEOUT: 124 | |
| EXIT_KILL: 137 | |
| MAX_ATTEMPTS: 3 | |
| SIGTERM_TIMEOUT: 60s | |
| SIGKILL_TIMEOUT: 10s | |
| PYTEST_TIMEOUT: 10 | |
| run: | | |
| set -ex | |
| pip install src/server/tests tests/server | |
| timeout -k $SIGKILL_TIMEOUT $SIGTERM_TIMEOUT \ | |
| pytest -vv \ | |
| --showlocals \ | |
| --timeout=$PYTEST_TIMEOUT \ | |
| --execution-strategy="concurrent" \ | |
| tests/server | |
| set +e | |
| for (( ATTEMPT = 1; ATTEMPT <= MAX_ATTEMPTS; ATTEMPT++ )); do | |
| echo "Attempt $ATTEMPT of $MAX_ATTEMPTS" | |
| timeout -k $SIGKILL_TIMEOUT $SIGTERM_TIMEOUT \ | |
| pytest -vv \ | |
| --showlocals \ | |
| --timeout=$PYTEST_TIMEOUT \ | |
| --execution-strategy="parallel" \ | |
| tests/server | |
| EXIT_CODE=$? | |
| if [ $EXIT_CODE -eq $EXIT_SUCCESS ]; then | |
| break | |
| fi | |
| echo "Command failed with exit code: $EXIT_CODE" 1>&2 | |
| done | |
| set -e | |
| exit $EXIT_CODE |