From fda181fa2458734049f86bcc0dfcbffbdf255161 Mon Sep 17 00:00:00 2001 From: David Kirov Date: Fri, 20 Dec 2024 22:26:35 +0100 Subject: [PATCH] Replace ddev with pytest in experimental workflow --- .github/workflows/experimental.yml | 45 ++++++++---------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml index 84d89ece075bd..8e3d099a23b8d 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/experimental.yml @@ -169,42 +169,20 @@ jobs: $env:OPENSSL_CONF = ".\openssl.cnf" .\openssl.exe list -providers - - name: Add Python to PATH + - name: Add Python to PATH Windows + if: runner.os == 'Windows' + shell: powershell run: | - if [[ "$RUNNER_OS" == "Windows" ]]; then - echo "PATH=$(pwd)\python_dir;$(pwd)\python_dir\Scripts;$PATH" >> $GITHUB_ENV - else - echo "PATH=$(pwd)/python_dir:$PATH" >> $GITHUB_ENV - fi + Add-Content -Path $env:GITHUB_ENV -Value "PATH=$(pwd)\python_dir;$(pwd)\python_dir\Scripts;$env:PATH" - - name: Install pip - run: | - python -m ensurepip - - - name: Restore cache - uses: actions/cache/restore@v4 - with: - path: ${{ runner.os == 'Windows' && '~\AppData\Local\pip\Cache' || '~/.cache/pip' }} - key: >- - ${{ format( - 'v01-python-{0}-{1}-{2}-{3}', - env.pythonLocation, - hashFiles('datadog_checks_base/pyproject.toml'), - hashFiles('datadog_checks_dev/pyproject.toml'), - hashFiles('ddev/pyproject.toml') - )}} - restore-keys: |- - v01-python-${{ env.pythonLocation }} - - - name: Install ddev from local folder + - name: Add Python to PATH Linux + if: runner.os == 'Linux' run: | - python.exe -m pip install -e ./datadog_checks_dev[cli] - python.exe -m pip install -e ./ddev + echo "PATH=$(pwd)/python_dir:$PATH" >> $GITHUB_ENV - - name: Configure ddev + - name: Install pip and pytest run: | - ddev config set repos.core . - ddev config set repo core + python -m ensurepip - name: Test if: runner.os == 'Windows' @@ -217,6 +195,7 @@ jobs: $env:OPENSSL_MODULES = "$(pwd)\ossl-modules" .\openssl.exe list -providers .\openssl.exe md5 - pytest ..\datadog_checks_base -m fips_off - pytest ..\datadog_checks_base -m fips_on + python -m pip install pytest + python -m pytest ..\datadog_checks_base -m fips_off + python -m pytest ..\datadog_checks_base -m fips_on python -c "import ssl; ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT).set_ciphers('MD5')"