From 38a175fb30d9f07e689b8caf9a9d93bf4f351bb5 Mon Sep 17 00:00:00 2001 From: Kanishk Date: Fri, 22 May 2026 14:48:42 +0530 Subject: [PATCH] RTECO-1189 - Add GitHub Actions workflow for Poetry tests --- .github/workflows/poetryTests.yml | 114 ++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/workflows/poetryTests.yml diff --git a/.github/workflows/poetryTests.yml b/.github/workflows/poetryTests.yml new file mode 100644 index 000000000..0568a6277 --- /dev/null +++ b/.github/workflows/poetryTests.yml @@ -0,0 +1,114 @@ +name: Poetry Tests +on: + workflow_dispatch: + inputs: + jfrog_url: + description: "External JFrog Platform URL. Leave empty for local Artifactory." + type: string + required: false + default: "" + jfrog_admin_token: + description: "Admin token for external JFrog Platform." + type: string + required: false + default: "" + poetry_version: + description: "Poetry version to install." + type: string + required: false + default: "1.8.5" + push: + branches: + - "master" + # Triggers the workflow on PRs to master from any branch (including forks). + # PRs from forks require the 'safe to test' label (gated below). + pull_request_target: + types: [labeled] + branches: + - "master" + +# Ensures that only the latest commit is running for each PR at a time. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + Poetry-Tests: + name: poetry ${{ matrix.os.name }} + if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'safe to test') + strategy: + fail-fast: false + matrix: + os: + - name: ubuntu + version: 24.04 + - name: windows + version: 2022 + - name: macos + version: 14 + runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }} + steps: + - name: Skip macOS - JGC-413 + if: matrix.os.name == 'macos' + run: | + echo "::warning::JGC-413 - Skip until artifactory bootstrap in osx is fixed" + exit 0 + + # Checkout the PR head ref so tests run against the branch that raised the PR, + # not the target branch. github.event.pull_request.head.sha is set for + # pull_request_target events (including PRs from forks). + - name: Checkout code + if: matrix.os.name != 'macos' + uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + + - name: Setup FastCI + if: matrix.os.name != 'macos' + uses: jfrog-fastci/fastci@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + fastci_otel_token: ${{ secrets.FASTCI_TOKEN }} + + - name: Setup Python3 + if: matrix.os.name != 'macos' + uses: actions/setup-python@v6 + with: + python-version: "3.11.5" + + - name: Setup Poetry + if: matrix.os.name != 'macos' + run: python -m pip install poetry==${{ inputs.poetry_version || '1.8.5' }} + + - name: Setup Go with cache + if: matrix.os.name != 'macos' + uses: jfrog/.github/actions/install-go-with-cache@main + + - name: Debug macOS Environment and Set Timeout + if: runner.os == 'macOS' + run: | + echo "=== macOS Debug Information ===" + echo "Architecture: $(uname -m)" + echo "macOS Version: $(sw_vers -productVersion)" + echo "macOS Build: $(sw_vers -buildVersion)" + echo "Available memory: $(system_profiler SPHardwareDataType | grep Memory || echo 'Memory info not available')" + echo "Available disk space: $(df -h)" + echo "Java version: $(java -version 2>&1 || echo 'Java not found')" + echo "Go version: $(go version)" + echo "Setting RT_CONNECTION_TIMEOUT_SECONDS to 2400 for macOS" + echo "RT_CONNECTION_TIMEOUT_SECONDS=2400" >> $GITHUB_ENV + + - name: Install local Artifactory + if: matrix.os.name != 'macos' + uses: jfrog/.github/actions/install-local-artifactory@main + with: + RTLIC: ${{ secrets.RTLIC }} + JFROG_URL: ${{ inputs.jfrog_url }} + JFROG_ADMIN_TOKEN: ${{ inputs.jfrog_admin_token }} + RT_CONNECTION_TIMEOUT_SECONDS: ${{ env.RT_CONNECTION_TIMEOUT_SECONDS || '1200' }} + + - name: Run Poetry tests + if: matrix.os.name != 'macos' + run: >- + go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.poetry + ${{ env.JFROG_TESTS_IS_EXTERNAL == 'true' && format('--jfrog.url={0} --jfrog.adminToken={1}', env.JFROG_TESTS_URL, env.JFROG_TESTS_LOCAL_ACCESS_TOKEN) || '' }}