diff --git a/.github/workflows/docker-dist-tests.yml b/.github/workflows/docker-dist-tests.yml index 2700e619..1cbc528a 100644 --- a/.github/workflows/docker-dist-tests.yml +++ b/.github/workflows/docker-dist-tests.yml @@ -17,6 +17,12 @@ on: - '!docker/codex.Dockerfile' - '!docker/docker-entrypoint.sh' workflow_dispatch: + inputs: + run_release_tests: + description: Run Release tests + required: false + type: boolean + default: false jobs: @@ -28,6 +34,5 @@ jobs: nat_ip_auto: true tag_latest: ${{ github.ref_name == github.event.repository.default_branch || startsWith(github.ref, 'refs/tags/') }} tag_suffix: dist-tests - continuous_tests_list: PeersTest HoldMyBeerTest - continuous_tests_duration: 12h + run_release_tests: ${{ inputs.run_release_tests }} secrets: inherit diff --git a/.github/workflows/docker-reusable.yml b/.github/workflows/docker-reusable.yml index ebd37ae8..14e2222c 100644 --- a/.github/workflows/docker-reusable.yml +++ b/.github/workflows/docker-reusable.yml @@ -54,6 +54,11 @@ on: description: Continuous Tests duration required: false type: string + run_release_tests: + description: Run Release tests + required: false + type: string + default: false env: @@ -67,8 +72,8 @@ env: TAG_SHA: ${{ inputs.tag_sha }} TAG_SUFFIX: ${{ inputs.tag_suffix }} # Tests - CONTINUOUS_TESTS_SOURCE: codex-storage/cs-codex-dist-tests - CONTINUOUS_TESTS_BRANCH: master + TESTS_SOURCE: codex-storage/cs-codex-dist-tests + TESTS_BRANCH: master CONTINUOUS_TESTS_LIST: ${{ inputs.continuous_tests_list }} CONTINUOUS_TESTS_DURATION: ${{ inputs.continuous_tests_duration }} CONTINUOUS_TESTS_NAMEPREFIX: c-tests-ci @@ -93,7 +98,7 @@ jobs: - target: os: linux arch: arm64 - builder: buildjet-4vcpu-ubuntu-2204-arm + builder: buildjet-8vcpu-ubuntu-2204-arm name: Build ${{ matrix.target.os }}/${{ matrix.target.arch }} runs-on: ${{ matrix.builder }} @@ -219,49 +224,73 @@ jobs: docker buildx imagetools inspect ${{ env.DOCKER_REPO }}:${{ steps.meta.outputs.version }} - # Compute Continuous Tests inputs + # Compute Tests inputs compute-tests-inputs: - name: Compute Continuous Tests list - if: ${{ inputs.continuous_tests_list != '' && github.ref_name == github.event.repository.default_branch }} + name: Compute Tests inputs + if: ${{ inputs.continuous_tests_list != '' || inputs.run_release_tests == 'true' }} runs-on: ubuntu-latest needs: publish outputs: source: ${{ steps.compute.outputs.source }} - branch: ${{ steps.compute.outputs.branch }} + branch: ${{ env.TESTS_BRANCH }} + workflow_source: ${{ env.TESTS_SOURCE }} codexdockerimage: ${{ steps.compute.outputs.codexdockerimage }} - nameprefix: ${{ steps.compute.outputs.nameprefix }} - continuous_tests_list: ${{ steps.compute.outputs.continuous_tests_list }} - continuous_tests_duration: ${{ steps.compute.outputs.continuous_tests_duration }} - continuous_tests_workflow: ${{ steps.compute.outputs.continuous_tests_workflow }} - workflow_source: ${{ steps.compute.outputs.workflow_source }} steps: - - name: Compute Continuous Tests list + - name: Compute Tests inputs id: compute run: | - echo "source=${{ format('{0}/{1}', github.server_url, env.CONTINUOUS_TESTS_SOURCE) }}" >> "$GITHUB_OUTPUT" - echo "branch=${{ env.CONTINUOUS_TESTS_BRANCH }}" >> "$GITHUB_OUTPUT" + echo "source=${{ format('{0}/{1}', github.server_url, env.TESTS_SOURCE) }}" >> "$GITHUB_OUTPUT" echo "codexdockerimage=${{ inputs.docker_repo }}:${{ needs.publish.outputs.version }}" >> "$GITHUB_OUTPUT" + + + # Compute Continuous Tests inputs + compute-continuous-tests-inputs: + name: Compute Continuous Tests inputs + if: ${{ inputs.continuous_tests_list != '' && github.ref_name == github.event.repository.default_branch }} + runs-on: ubuntu-latest + needs: compute-tests-inputs + outputs: + nameprefix: ${{ steps.compute.outputs.nameprefix }} + continuous_tests_list: ${{ steps.compute.outputs.continuous_tests_list }} + continuous_tests_duration: ${{ env.CONTINUOUS_TESTS_DURATION }} + continuous_tests_workflow: ${{ steps.compute.outputs.continuous_tests_workflow }} + steps: + - name: Compute Continuous Tests inputs + id: compute + run: | echo "nameprefix=$(awk '{ print tolower($0) }' <<< ${{ env.CONTINUOUS_TESTS_NAMEPREFIX }})" >> "$GITHUB_OUTPUT" echo "continuous_tests_list=$(jq -cR 'split(" ")' <<< '${{ env.CONTINUOUS_TESTS_LIST }}')" >> "$GITHUB_OUTPUT" - echo "continuous_tests_duration=${{ env.CONTINUOUS_TESTS_DURATION }}" >> "$GITHUB_OUTPUT" - echo "workflow_source=${{ env.CONTINUOUS_TESTS_SOURCE }}" >> "$GITHUB_OUTPUT" # Run Continuous Tests - run-tests: + run-continuous-tests: name: Run Continuous Tests - needs: [publish, compute-tests-inputs] + needs: [compute-tests-inputs, compute-continuous-tests-inputs] strategy: max-parallel: 1 matrix: - tests: ${{ fromJSON(needs.compute-tests-inputs.outputs.continuous_tests_list) }} + tests: ${{ fromJSON(needs.compute-continuous-tests-inputs.outputs.continuous_tests_list) }} uses: codex-storage/cs-codex-dist-tests/.github/workflows/run-continuous-tests.yaml@master with: source: ${{ needs.compute-tests-inputs.outputs.source }} branch: ${{ needs.compute-tests-inputs.outputs.branch }} codexdockerimage: ${{ needs.compute-tests-inputs.outputs.codexdockerimage }} - nameprefix: ${{ needs.compute-tests-inputs.outputs.nameprefix }}-${{ matrix.tests }}-${{ needs.compute-tests-inputs.outputs.continuous_tests_duration }} + nameprefix: ${{ needs.compute-continuous-tests-inputs.outputs.nameprefix }}-${{ matrix.tests }}-${{ needs.compute-continuous-tests-inputs.outputs.continuous_tests_duration }} tests_filter: ${{ matrix.tests }} tests_target_duration: ${{ needs.compute-tests-inputs.outputs.continuous_tests_duration }} workflow_source: ${{ needs.compute-tests-inputs.outputs.workflow_source }} secrets: inherit + + + # Run Release Tests + run-release-tests: + name: Run Release Tests + needs: [compute-tests-inputs] + if: ${{ inputs.run_release_tests == 'true' }} + uses: codex-storage/cs-codex-dist-tests/.github/workflows/run-release-tests.yaml@master + with: + source: ${{ needs.compute-tests-inputs.outputs.source }} + branch: ${{ needs.compute-tests-inputs.outputs.branch }} + codexdockerimage: ${{ needs.compute-tests-inputs.outputs.codexdockerimage }} + workflow_source: ${{ needs.compute-tests-inputs.outputs.workflow_source }} + secrets: inherit