workflow to run cli integration tests #2
Workflow file for this run
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: CLI Integration Tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request_target: | |
| types: [labeled] | |
| branches: | |
| - main | |
| # Temporary: Using pull_request to test before merging to main | |
| # This runs the workflow from the PR branch | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| Remove-Label: | |
| if: contains(github.event.pull_request.labels.*.name, 'safe to test') | |
| name: Remove label | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Remove 'safe to test' | |
| uses: actions-ecosystem/action-remove-labels@v1 | |
| with: | |
| labels: "safe to test" | |
| Detect-Replaces: | |
| name: Detect Dependencies | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'safe to test') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| build_info_go_repo: ${{ steps.detect.outputs.build_info_go_repo }} | |
| build_info_go_ref: ${{ steps.detect.outputs.build_info_go_ref }} | |
| client_go_repo: ${{ steps.detect.outputs.client_go_repo }} | |
| client_go_ref: ${{ steps.detect.outputs.client_go_ref }} | |
| cli_core_repo: ${{ steps.detect.outputs.cli_core_repo }} | |
| cli_core_ref: ${{ steps.detect.outputs.cli_core_ref }} | |
| steps: | |
| - name: Checkout jfrog-cli-artifactory | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Detect replace directives | |
| id: detect | |
| run: | | |
| echo "============================================" | |
| echo "Parsing go.mod for replace directives..." | |
| echo "============================================" | |
| # Function to extract repo and ref from replace directive | |
| extract_replace() { | |
| local module=$1 | |
| local line=$(grep "^replace github.com/jfrog/$module " go.mod 2>/dev/null | head -1) | |
| if [ -n "$line" ]; then | |
| local target=$(echo "$line" | sed -n 's/.*=> github.com\/\(.*\)/\1/p') | |
| local repo=$(echo "$target" | awk '{print $1}') | |
| local ref=$(echo "$target" | awk '{print $2}') | |
| echo "${repo}|${ref}" | |
| fi | |
| } | |
| echo "" | |
| echo "Current go.mod replace directives:" | |
| grep "^replace " go.mod || echo "(no replace directives found)" | |
| echo "" | |
| # Check for build-info-go | |
| BUILD_INFO=$(extract_replace "build-info-go") | |
| if [ -n "$BUILD_INFO" ]; then | |
| REPO=$(echo "$BUILD_INFO" | cut -d'|' -f1) | |
| REF=$(echo "$BUILD_INFO" | cut -d'|' -f2) | |
| echo "build_info_go_repo=${REPO}" >> $GITHUB_OUTPUT | |
| echo "build_info_go_ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "✅ build-info-go => ${REPO} @ ${REF}" | |
| else | |
| echo "build_info_go_repo=" >> $GITHUB_OUTPUT | |
| echo "build_info_go_ref=" >> $GITHUB_OUTPUT | |
| echo "⏭️ build-info-go: using default" | |
| fi | |
| # Check for jfrog-client-go | |
| CLIENT_GO=$(extract_replace "jfrog-client-go") | |
| if [ -n "$CLIENT_GO" ]; then | |
| REPO=$(echo "$CLIENT_GO" | cut -d'|' -f1) | |
| REF=$(echo "$CLIENT_GO" | cut -d'|' -f2) | |
| echo "client_go_repo=${REPO}" >> $GITHUB_OUTPUT | |
| echo "client_go_ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "✅ jfrog-client-go => ${REPO} @ ${REF}" | |
| else | |
| echo "client_go_repo=" >> $GITHUB_OUTPUT | |
| echo "client_go_ref=" >> $GITHUB_OUTPUT | |
| echo "⏭️ jfrog-client-go: using default" | |
| fi | |
| # Check for jfrog-cli-core | |
| CLI_CORE=$(extract_replace "jfrog-cli-core") | |
| if [ -n "$CLI_CORE" ]; then | |
| REPO=$(echo "$CLI_CORE" | cut -d'|' -f1) | |
| REF=$(echo "$CLI_CORE" | cut -d'|' -f2) | |
| echo "cli_core_repo=${REPO}" >> $GITHUB_OUTPUT | |
| echo "cli_core_ref=${REF}" >> $GITHUB_OUTPUT | |
| echo "✅ jfrog-cli-core => ${REPO} @ ${REF}" | |
| else | |
| echo "cli_core_repo=" >> $GITHUB_OUTPUT | |
| echo "cli_core_ref=" >> $GITHUB_OUTPUT | |
| echo "⏭️ jfrog-cli-core: using default" | |
| fi | |
| Artifactory-Tests: | |
| name: ${{ matrix.suite }} ${{ matrix.os.name }} | |
| needs: Detect-Replaces | |
| 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: | |
| suite: [artifactory, artifactoryProject] | |
| os: | |
| - name: ubuntu | |
| version: 24.04 | |
| - name: windows | |
| version: 2022 | |
| - name: macos | |
| version: 14 | |
| runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }} | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| 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 | |
| - name: Checkout jfrog-cli-artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Go with cache | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Add replace directives (Unix) | |
| if: matrix.os.name == 'ubuntu' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| cat go.mod | tail -10 | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os.name == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| Get-Content go.mod | Select-Object -Last 10 | |
| go mod tidy | |
| - name: Install local Artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-local-artifactory@main | |
| with: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| RT_CONNECTION_TIMEOUT_SECONDS: '1200' | |
| - name: Run Artifactory tests | |
| if: matrix.suite == 'artifactory' && matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.artifactory --jfrog.url=http://127.0.0.1:8082 --jfrog.adminToken=${{ env.JFROG_TESTS_LOCAL_ACCESS_TOKEN }} | |
| - name: Run Artifactory Project tests | |
| if: matrix.suite == 'artifactoryProject' && matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.artifactoryProject --ci.runId=${{ runner.os }}-${{ matrix.suite }} | |
| npm-Tests: | |
| name: npm ${{ matrix.os.name }} | |
| needs: Detect-Replaces | |
| 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 }} | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| 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 | |
| - name: Checkout jfrog-cli-artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Install npm | |
| if: matrix.os.name != 'macos' | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "16" | |
| - name: Setup Go with cache | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Add replace directives (Unix) | |
| if: matrix.os.name == 'ubuntu' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os.name == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| go mod tidy | |
| - name: Install local Artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-local-artifactory@main | |
| with: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| RT_CONNECTION_TIMEOUT_SECONDS: '1200' | |
| - name: Run npm tests | |
| if: matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| env: | |
| YARN_IGNORE_NODE: 1 | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.npm | |
| Maven-Tests: | |
| name: Maven ${{ matrix.os.name }} | |
| needs: Detect-Replaces | |
| 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 }} | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| 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 | |
| - name: Checkout jfrog-cli-artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Go with cache | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Setup Maven v3.8.8 | |
| if: matrix.os.name != 'macos' | |
| uses: stCarolas/setup-maven@v5 | |
| with: | |
| maven-version: 3.8.8 | |
| - name: Add replace directives (Unix) | |
| if: matrix.os.name == 'ubuntu' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os.name == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| go mod tidy | |
| - name: Install local Artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-local-artifactory@main | |
| with: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| RT_CONNECTION_TIMEOUT_SECONDS: '1200' | |
| - name: Run Maven tests | |
| if: matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.maven | |
| Gradle-Tests: | |
| name: Gradle ${{ matrix.gradle-version }} ${{ matrix.os.name }} | |
| needs: Detect-Replaces | |
| 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 | |
| gradle-version: [5.6.4, 8.3] | |
| runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }} | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| GRADLE_OPTS: -Dorg.gradle.daemon=false | |
| 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 | |
| - name: Checkout jfrog-cli-artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Java | |
| if: matrix.os.name != 'macos' | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: "temurin" | |
| java-version: "11" | |
| - name: Setup Gradle | |
| if: matrix.os.name != 'macos' | |
| uses: gradle/gradle-build-action@v3 | |
| with: | |
| gradle-version: ${{ matrix.gradle-version }} | |
| - name: Setup Go with cache | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Add replace directives (Unix) | |
| if: matrix.os.name == 'ubuntu' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os.name == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| go mod tidy | |
| - name: Install local Artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-local-artifactory@main | |
| with: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| RT_CONNECTION_TIMEOUT_SECONDS: '1200' | |
| - name: Run Gradle tests | |
| if: matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.gradle | |
| Conan-Tests: | |
| name: Conan ${{ matrix.os.name }} | |
| needs: Detect-Replaces | |
| 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 }} | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| 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 | |
| - name: Checkout jfrog-cli-artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Go with cache | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Install Conan | |
| if: matrix.os.name != 'macos' | |
| uses: turtlebrowser/get-conan@main | |
| with: | |
| version: '2.10.2' | |
| - name: Add replace directives (Unix) | |
| if: matrix.os.name == 'ubuntu' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os.name == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| go mod tidy | |
| - name: Install local Artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-local-artifactory@main | |
| with: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| RT_CONNECTION_TIMEOUT_SECONDS: '1200' | |
| - name: Run Conan tests | |
| if: matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.conan | |
| Helm-Tests: | |
| name: Helm ${{ matrix.os.name }} | |
| needs: Detect-Replaces | |
| 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 }} | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| 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 | |
| - name: Checkout jfrog-cli-artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Go with cache | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Install Helm | |
| if: matrix.os.name != 'macos' | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: 'latest' | |
| - name: Add replace directives (Unix) | |
| if: matrix.os.name == 'ubuntu' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os.name == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| go mod tidy | |
| - name: Install local Artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-local-artifactory@main | |
| with: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| RT_CONNECTION_TIMEOUT_SECONDS: '1200' | |
| - name: Run Helm tests | |
| if: matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.helm | |
| Docker-Tests: | |
| name: Docker ubuntu | |
| needs: Detect-Replaces | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'safe to test') | |
| runs-on: ubuntu-24.04 | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| steps: | |
| - name: Checkout jfrog-cli-artifactory | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Go with cache | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Add replace directives | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Containerize Artifactory | |
| run: | | |
| cd jfrog-cli/testdata/docker/artifactory/ | |
| ./start.sh | |
| env: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| GOPROXY: direct | |
| - name: Wait for Artifactory to finish loading | |
| uses: nev7n/wait_for_response@v1 | |
| with: | |
| url: "http://localhost:8082" | |
| responseCode: 200 | |
| timeout: 600000 | |
| interval: 500 | |
| - name: Run Docker tests | |
| working-directory: jfrog-cli | |
| run: go test -v -timeout 0 --test.docker | |
| Podman-Tests: | |
| name: Podman ubuntu | |
| needs: Detect-Replaces | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'safe to test') | |
| runs-on: ubuntu-24.04 | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| steps: | |
| - name: Checkout jfrog-cli-artifactory | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Go with cache | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Add replace directives | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Run Podman tests | |
| working-directory: jfrog-cli | |
| run: go test -v -timeout 0 --test.podman --jfrog.url=${{ secrets.EPLUS_PLATFORM_URL }} --jfrog.adminToken=${{ secrets.EPLUS_ADMIN_TOKEN }} --test.containerRegistry=${{ secrets.CONTAINER_REGISTRY }} | |
| Python-Tests: | |
| name: ${{ matrix.suite }} ${{ matrix.os.name }} | |
| needs: Detect-Replaces | |
| 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: | |
| suite: [pip, pipenv] | |
| os: | |
| - name: ubuntu | |
| version: 24.04 | |
| - name: windows | |
| version: 2022 | |
| - name: macos | |
| version: 14 | |
| runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }} | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| 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 | |
| - name: Checkout jfrog-cli-artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Python3 | |
| if: matrix.os.name != 'macos' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11.5" | |
| - name: Setup Pipenv | |
| if: matrix.suite == 'pipenv' && matrix.os.name != 'macos' | |
| run: python -m pip install pipenv | |
| - name: Setup Twine | |
| if: matrix.suite == 'pip' && matrix.os.name != 'macos' | |
| run: python -m pip install twine | |
| - name: Setup Go with cache | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Add replace directives (Unix) | |
| if: matrix.os.name == 'ubuntu' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os.name == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| go mod tidy | |
| - name: Install local Artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-local-artifactory@main | |
| with: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| RT_CONNECTION_TIMEOUT_SECONDS: '1200' | |
| - name: Run Python tests | |
| if: matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.${{ matrix.suite }} | |
| Lifecycle-Tests: | |
| name: Lifecycle ${{ matrix.os.name }} | |
| needs: Detect-Replaces | |
| 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 }} | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| 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 | |
| - name: Checkout jfrog-cli-artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| if: matrix.os.name != 'macos' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: matrix.os.name != 'macos' && needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Go with cache | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Add replace directives (Unix) | |
| if: matrix.os.name == 'ubuntu' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os.name == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| go mod tidy | |
| - name: Install local Artifactory | |
| if: matrix.os.name != 'macos' | |
| uses: jfrog/.github/actions/install-local-artifactory@main | |
| with: | |
| RTLIC: ${{ secrets.RTLIC }} | |
| RT_CONNECTION_TIMEOUT_SECONDS: '1200' | |
| - name: Run Lifecycle tests | |
| if: matrix.os.name != 'macos' | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.lifecycle --jfrog.url=http://127.0.0.1:8082 --jfrog.adminToken=${{ env.JFROG_TESTS_LOCAL_ACCESS_TOKEN }} --ci.runId=${{ runner.os }}-lifecycle | |
| Distribution-Tests: | |
| name: Distribution ${{ matrix.os }} | |
| needs: Detect-Replaces | |
| 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: [ubuntu, windows, macos] | |
| runs-on: ${{ matrix.os }}-latest | |
| env: | |
| JFROG_CLI_LOG_LEVEL: DEBUG | |
| GOPROXY: direct | |
| steps: | |
| - name: Checkout jfrog-cli-artifactory | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| path: jfrog-cli-artifactory | |
| - name: Checkout jfrog-cli | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: jfrog/jfrog-cli | |
| ref: master | |
| path: jfrog-cli | |
| - name: Checkout build-info-go (if needed) | |
| if: needs.Detect-Replaces.outputs.build_info_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.build_info_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.build_info_go_ref }} | |
| path: build-info-go | |
| - name: Checkout jfrog-client-go (if needed) | |
| if: needs.Detect-Replaces.outputs.client_go_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.client_go_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.client_go_ref }} | |
| path: jfrog-client-go | |
| - name: Checkout jfrog-cli-core (if needed) | |
| if: needs.Detect-Replaces.outputs.cli_core_repo != '' | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ needs.Detect-Replaces.outputs.cli_core_repo }} | |
| ref: ${{ needs.Detect-Replaces.outputs.cli_core_ref }} | |
| path: jfrog-cli-core | |
| - name: Setup Go with cache | |
| uses: jfrog/.github/actions/install-go-with-cache@main | |
| - name: Add replace directives (Unix) | |
| if: matrix.os != 'windows' | |
| shell: bash | |
| run: | | |
| cd jfrog-cli | |
| echo "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" >> go.mod | |
| [ -d "../build-info-go" ] && echo "replace github.com/jfrog/build-info-go => ../build-info-go" >> go.mod | |
| [ -d "../jfrog-client-go" ] && echo "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" >> go.mod | |
| [ -d "../jfrog-cli-core" ] && echo "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" >> go.mod | |
| go mod tidy | |
| - name: Add replace directives (Windows) | |
| if: matrix.os == 'windows' | |
| shell: pwsh | |
| run: | | |
| cd jfrog-cli | |
| Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-artifactory => ../jfrog-cli-artifactory" | |
| if (Test-Path "../build-info-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/build-info-go => ../build-info-go" } | |
| if (Test-Path "../jfrog-client-go") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-client-go => ../jfrog-client-go" } | |
| if (Test-Path "../jfrog-cli-core") { Add-Content -Path go.mod -Value "replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core" } | |
| go mod tidy | |
| - name: Run Distribution tests | |
| working-directory: jfrog-cli | |
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.distribution --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --ci.runId=${{ runner.os }}-distribution |