diff --git a/.github/workflows/bump-stage-and-upload-to-jfrog.yml b/.github/workflows/bump-stage-and-upload-to-jfrog.yml index 922c94de93..7d54364bdb 100644 --- a/.github/workflows/bump-stage-and-upload-to-jfrog.yml +++ b/.github/workflows/bump-stage-and-upload-to-jfrog.yml @@ -1,6 +1,11 @@ on: workflow_call: inputs: + dry-run: + required: false + default: false + type: boolean + description: "Don't tag or upload anything to JFrog" passed-dev-tag: type: string description: Dev tag to fast forward the stage branch to @@ -31,6 +36,7 @@ jobs: with: change: 'promote-dev-build-to-rc' ref: ${{ vars.STAGE_BRANCH_NAME }} + dry-run: ${{ inputs.dry-run }} secrets: inherit rebuild-artifacts-with-rc-version: @@ -50,6 +56,7 @@ jobs: uses: ./.github/workflows/upload-to-jfrog.yml with: version: ${{ needs.promote-dev-build-to-rc.outputs.new_version }} + dry-run: ${{ inputs.dry-run }} secrets: inherit # See reason for deleting artifacts in dev-workflow-p2.yml diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 736663f431..f972a0f19d 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -5,6 +5,11 @@ name: Bump version on: workflow_dispatch: inputs: + dry-run: + required: false + default: false + type: boolean + description: "Don't tag" change: type: choice description: Python script name to update the version @@ -15,6 +20,11 @@ on: - promote-rc-build-to-release workflow_call: inputs: + dry-run: + required: false + default: false + type: boolean + description: "Don't tag" change: # Since workflow_call doesn't support 'options' input type, # we take in a string instead that must be a valid Python script name (excluding the .py part) @@ -93,4 +103,5 @@ jobs: with: new_version: ${{ needs.get-new-version.outputs.new_version }} ref: ${{ inputs.is_workflow_call && inputs.ref || github.ref }} + dry-run: ${{ inputs.dry-run }} secrets: inherit diff --git a/.github/workflows/dev-to-stage.yml b/.github/workflows/dev-to-stage.yml index beec6c94ab..8bf2f6f99f 100644 --- a/.github/workflows/dev-to-stage.yml +++ b/.github/workflows/dev-to-stage.yml @@ -3,6 +3,25 @@ name: Dev to stage on: # This workflow manipulates the stage and dev branches regardless of the branch this workflow is run from workflow_dispatch: + inputs: + registry-name: + required: true + default: docker.io + description: 'Docker registry' + server-tag: + required: true + default: 'latest' + description: 'Server docker image tag' + # For debugging + dry-run: + required: false + default: false + type: boolean + description: "Don't tag or upload anything to JFrog" + test-file: + required: false + default: '' + description: 'new_tests/' jobs: # We want to skip the stage tests if the changes made between dev and stage wouldn't affect the results of the stage tests @@ -46,6 +65,9 @@ jobs: with: use_jfrog_builds: true jfrog-build-version-to-test: ${{ needs.compare-latest-dev-tag-and-stage.outputs.latest-dev-tag }} + registry-name: ${{ inputs.registry-name }} + server-tag: ${{ inputs.server-tag }} + test-file: ${{ inputs.test-file }} # Stage tests have passed or skipped # so it is safe to update the stage branch with the changes in dev, promote the version to an RC, and rebuild and upload the RC to JFrog @@ -62,4 +84,5 @@ jobs: uses: ./.github/workflows/bump-stage-and-upload-to-jfrog.yml with: passed-dev-tag: ${{ needs.compare-latest-dev-tag-and-stage.outputs.latest-dev-tag }} + dry-run: ${{ inputs.dry-run }} secrets: inherit diff --git a/.github/workflows/stage-tests.yml b/.github/workflows/stage-tests.yml index 1c76ea938a..8fd5d60f8e 100644 --- a/.github/workflows/stage-tests.yml +++ b/.github/workflows/stage-tests.yml @@ -34,6 +34,11 @@ on: required: false default: 'latest' description: 'Server docker image tag' + test-file: + required: false + default: '' + type: string + description: 'new_tests/' test-macos-x86: required: false type: boolean @@ -176,7 +181,7 @@ jobs: run: docker exec --workdir /aerospike-client-python/test ${{ env.LINUX_DISTRO_CONTAINER_NAME }} python${{ env.PYTHON_VERSION }} -m ${{ env.PIP_INSTALL_COMMAND }} pytest -c requirements.txt - name: Run tests - run: docker exec --workdir /aerospike-client-python/test ${{ env.LINUX_DISTRO_CONTAINER_NAME }} python${{ env.PYTHON_VERSION }} -m pytest new_tests/ + run: docker exec --workdir /aerospike-client-python/test ${{ env.LINUX_DISTRO_CONTAINER_NAME }} python${{ env.PYTHON_VERSION }} -m pytest new_tests/${{ inputs.test-file }} macOS: if: ${{ inputs.test-macos-x86 }} @@ -251,7 +256,7 @@ jobs: - name: Run tests if: ${{ matrix.runner-os-and-arch[1] == 'x86_64' }} - run: python3 -m pytest new_tests/ + run: python3 -m pytest new_tests/${{ inputs.test-file }} working-directory: test - name: Run tests on macos 26 diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml index 0098a64f2c..55a7cbdb2e 100644 --- a/.github/workflows/update-version.yml +++ b/.github/workflows/update-version.yml @@ -5,12 +5,22 @@ name: Update version in repo on: workflow_dispatch: inputs: + dry-run: + required: false + default: false + type: boolean + description: "Don't tag" new_version: type: string description: Version string to set in the repo required: true workflow_call: inputs: + dry-run: + required: false + default: false + type: boolean + description: "Don't tag" new_version: type: string description: Version string to set in the repo @@ -61,7 +71,7 @@ jobs: with: commit_message: 'Auto-bump version to ${{ inputs.new_version }} [skip ci]' commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - tagging_message: ${{ inputs.new_version }} + tagging_message: ${{ !inputs.dry-run && inputs.new_version || '' }} branch: ${{ inputs.is_workflow_call && inputs.ref || github.ref }} - name: Output bump commit hash for next jobs to use diff --git a/.github/workflows/upload-to-jfrog.yml b/.github/workflows/upload-to-jfrog.yml index 4b1e480db1..e865b28ed9 100644 --- a/.github/workflows/upload-to-jfrog.yml +++ b/.github/workflows/upload-to-jfrog.yml @@ -3,6 +3,11 @@ name: Upload to JFrog on: workflow_call: inputs: + dry-run: + required: false + default: false + type: boolean + description: "Don't upload to jfrog" version: type: string required: false @@ -39,19 +44,22 @@ jobs: JF_URL: ${{ secrets.JFROG_PLATFORM_URL }} JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }} + - if: ${{ inputs.dry-run }} + run: echo "DRY_RUN_FLAG=--dry-run" >> $GITHUB_ENV + - name: Upload manylinux builds from arbitrary branches to JFrog generic repo if: ${{ inputs.jfrog-repo-name == vars.JFROG_GENERIC_REPO_NAME }} - run: jf rt upload "*manylinux*" ${{ vars.JFROG_GENERIC_REPO_NAME }}/${{ github.ref_name }}/ + run: jf rt upload $DRY_RUN_FLAG "*manylinux*" ${{ vars.JFROG_GENERIC_REPO_NAME }}/${{ github.ref_name }}/ working-directory: artifacts - name: Upload passing builds to JFrog PyPI repo if: ${{ inputs.jfrog-repo-name == vars.JFROG_REPO_NAME }} # Source path must be in quotes if it contains an asterisk # https://github.com/jfrog/jfrog-cli/issues/1775#issuecomment-1348986551 - run: jf rt upload --build-name python-client --build-number $NEW_VERSION "artifacts/*" ${{ vars.JFROG_REPO_NAME }}/aerospike/$NEW_VERSION/ + run: jf rt upload $DRY_RUN_FLAG --build-name python-client --build-number $NEW_VERSION "artifacts/*" ${{ vars.JFROG_REPO_NAME }}/aerospike/$NEW_VERSION/ env: NEW_VERSION: ${{ inputs.version }} - name: Publish build info if: ${{ inputs.jfrog-repo-name == vars.JFROG_REPO_NAME }} - run: jf rt build-publish python-client ${{ inputs.version }} + run: jf rt build-publish $DRY_RUN_FLAG python-client ${{ inputs.version }}