From 76fb5a10047374ab4815e523800dddb2f1bafc7c Mon Sep 17 00:00:00 2001 From: Kyle Harding Date: Mon, 8 Apr 2024 09:26:10 -0400 Subject: [PATCH] Change setup job names Signed-off-by: Kyle Harding --- .github/workflows/flowzone.yml | 150 ++++++++++++++++----------------- flowzone.yml | 144 +++++++++++++++---------------- 2 files changed, 147 insertions(+), 147 deletions(-) diff --git a/.github/workflows/flowzone.yml b/.github/workflows/flowzone.yml index 703259d28..2468c9ac9 100644 --- a/.github/workflows/flowzone.yml +++ b/.github/workflows/flowzone.yml @@ -673,7 +673,7 @@ jobs: working-directory: . run: | echo "json=$(git ls-files | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT - is_npm: + npm_setup: name: Setup npm runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -778,7 +778,7 @@ jobs: then echo "json=${NODE_VERSIONS}" >> $GITHUB_OUTPUT fi - is_docker: + docker_setup: name: Setup docker runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -982,7 +982,7 @@ jobs: else error("Unsupported target: \($t)") end)' <<< "${matrix}")" echo "build=${matrix}">> $GITHUB_OUTPUT - is_python: + python_setup: name: Setup python env: SUPPORTED_VERSIONS: | @@ -1066,7 +1066,7 @@ jobs: then echo "json=${PYTHON_VERSIONS}" >> $GITHUB_OUTPUT fi - is_cargo: + cargo_setup: name: Setup rust runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -1125,7 +1125,7 @@ jobs: env: INPUT: ${{ inputs.cargo_targets }} DELIMITER: "," - is_balena: + balena_setup: name: Setup balena runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -1633,7 +1633,7 @@ jobs: env: INPUT: ${{ inputs.custom_environments }} DELIMITER: "," - is_cloudformation: + cloudformation_setup: name: Setup CloudFormation runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -1704,7 +1704,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_npm + - npm_setup - versioned_source if: | github.event.pull_request.state == 'open' @@ -1715,7 +1715,7 @@ jobs: strategy: fail-fast: false matrix: - node_version: ${{ fromJSON(needs.is_npm.outputs.node_versions) }} + node_version: ${{ fromJSON(needs.npm_setup.outputs.node_versions) }} outputs: package: ${{ steps.meta.outputs.package }} version: ${{ steps.meta.outputs.version }} @@ -1751,7 +1751,7 @@ jobs: - name: Sort node versions id: node_versions env: - VERSIONS: ${{ needs.is_npm.outputs.node_versions }} + VERSIONS: ${{ needs.npm_setup.outputs.node_versions }} run: | echo "min=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort | head -n1)" >> $GITHUB_OUTPUT echo "max=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort --reverse | head -n1)" >> $GITHUB_OUTPUT @@ -1761,13 +1761,13 @@ jobs: node-version: ${{ matrix.node_version }} registry-url: ${{ env.NPM_REGISTRY }} cache: npm - if: needs.is_npm.outputs.has_lockfile == 'true' + if: needs.npm_setup.outputs.has_lockfile == 'true' - name: Setup Node.js uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 with: node-version: ${{ matrix.node_version }} registry-url: ${{ env.NPM_REGISTRY }} - if: needs.is_npm.outputs.has_lockfile != 'true' + if: needs.npm_setup.outputs.has_lockfile != 'true' - name: Generate metadata id: meta run: | @@ -1792,7 +1792,7 @@ jobs: index="$(jq --arg os "${runner_os}" '.os | index($os) | select( . != null )' package.json)" if [[ -n "$index" ]] || [[ "$os_count" -lt 1 ]]; then - if [ ${{ needs.is_npm.outputs.has_lockfile }} == 'true' ]; then + if [ ${{ needs.npm_setup.outputs.has_lockfile }} == 'true' ]; then npm ci else npm i @@ -1810,28 +1810,28 @@ jobs: shell: script -q -e -c "bash --noprofile --norc -eo pipefail -x {0}" /tmp/test-session run: npm test - name: Run pack - if: needs.is_npm.outputs.is_private != 'true' && steps.node_versions.outputs.max == matrix.node_version + if: needs.npm_setup.outputs.is_private != 'true' && steps.node_versions.outputs.max == matrix.node_version run: | mkdir ${{ runner.temp }}/npm-pack && npm pack --pack-destination=${{ runner.temp }}/npm-pack # FIXME: workaround when `npm pack` for npm 6.x dumps tarball into the current directory because it has no `--pack-destination` flag [[ "$(npm --version)" =~ ^6\..* ]] && find . -maxdepth 1 -name '*.tgz' -exec mv {} ${{ runner.temp }}/npm-pack \; || true - name: Upload artifact - if: needs.is_npm.outputs.is_private != 'true' && steps.node_versions.outputs.max == matrix.node_version + if: needs.npm_setup.outputs.is_private != 'true' && steps.node_versions.outputs.max == matrix.node_version uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 with: name: npm-${{ github.event.pull_request.head.sha }}-${{ matrix.node_version }} path: ${{ runner.temp }}/npm-pack/*.tgz retention-days: 90 - name: Generate docs (if present) - if: needs.is_npm.outputs.has_docs == 'true' + if: needs.npm_setup.outputs.has_docs == 'true' shell: bash run: npm run doc - name: Compress docs - if: needs.is_npm.outputs.has_docs == 'true' && steps.node_versions.outputs.max == matrix.node_version + if: needs.npm_setup.outputs.has_docs == 'true' && steps.node_versions.outputs.max == matrix.node_version run: tar --auto-compress -cvf ${{ runner.temp }}/docs.tar.zst ./docs - name: Upload artifact - if: needs.is_npm.outputs.has_docs == 'true' && steps.node_versions.outputs.max == matrix.node_version + if: needs.npm_setup.outputs.has_docs == 'true' && steps.node_versions.outputs.max == matrix.node_version uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 with: name: docs-${{ github.event.pull_request.head.sha }}-${{ matrix.node_version }} @@ -1842,7 +1842,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_npm + - npm_setup - npm_test - custom_test - docker_test @@ -1851,7 +1851,7 @@ jobs: if: | !failure() && !cancelled() && needs.npm_test.result == 'success' && - needs.is_npm.outputs.is_private != 'true' + needs.npm_setup.outputs.is_private != 'true' defaults: run: working-directory: . @@ -1860,7 +1860,7 @@ jobs: - name: Sort node versions id: node_versions env: - VERSIONS: ${{ needs.is_npm.outputs.node_versions }} + VERSIONS: ${{ needs.npm_setup.outputs.node_versions }} run: | echo "min=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort | head -n1)" >> $GITHUB_OUTPUT echo "max=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort --reverse | head -n1)" >> $GITHUB_OUTPUT @@ -1890,17 +1890,17 @@ jobs: if [ ${{ github.run_attempt }} -gt 1 ]; then npm --loglevel=verbose --logs-max=0 unpublish ${{ needs.npm_test.outputs.package }}@${{ needs.npm_test.outputs.version_tag }}-$((${{ github.run_attempt }} - 1)) || true fi - npm --loglevel=verbose --logs-max=0 publish --tag=${{ needs.npm_test.outputs.sha_tag }} "${pack}" --access="${{ needs.is_npm.outputs.npm_access }}" + npm --loglevel=verbose --logs-max=0 publish --tag=${{ needs.npm_test.outputs.sha_tag }} "${pack}" --access="${{ needs.npm_setup.outputs.npm_access }}" npm --loglevel=verbose --logs-max=0 dist-tag add ${{ needs.npm_test.outputs.package }}@${{ needs.npm_test.outputs.version_tag }}-${{ github.run_attempt }} ${{ needs.npm_test.outputs.branch_tag }} npm_finalize: name: Finalize npm runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_npm + - npm_setup if: | (github.event.pull_request.merged == true || github.event_name == 'push') && - needs.is_npm.outputs.is_private != 'true' + needs.npm_setup.outputs.is_private != 'true' defaults: run: working-directory: . @@ -1923,7 +1923,7 @@ jobs: - name: Sort node versions id: node_versions env: - VERSIONS: ${{ needs.is_npm.outputs.node_versions }} + VERSIONS: ${{ needs.npm_setup.outputs.node_versions }} run: | echo "min=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort | head -n1)" >> $GITHUB_OUTPUT echo "max=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort --reverse | head -n1)" >> $GITHUB_OUTPUT @@ -1946,16 +1946,16 @@ jobs: run: | npm config set ignore-scripts true pack="$(ls ${{ runner.temp }}/*.tgz | sort -t- -n -k3 | tail -n1)" - npm --loglevel=verbose --logs-max=0 publish --tag "latest" "${pack}" --access="${{ needs.is_npm.outputs.npm_access }}" + npm --loglevel=verbose --logs-max=0 publish --tag "latest" "${pack}" --access="${{ needs.npm_setup.outputs.npm_access }}" npm_docs_finalize: name: Finalize npm docs runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_npm + - npm_setup if: | (github.event.pull_request.merged == true || github.event_name == 'push') && - needs.is_npm.outputs.has_docs == 'true' + needs.npm_setup.outputs.has_docs == 'true' defaults: run: working-directory: . @@ -1979,7 +1979,7 @@ jobs: - name: Sort node versions id: node_versions env: - VERSIONS: ${{ needs.is_npm.outputs.node_versions }} + VERSIONS: ${{ needs.npm_setup.outputs.node_versions }} run: | echo "min=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort | head -n1)" >> $GITHUB_OUTPUT echo "max=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort --reverse | head -n1)" >> $GITHUB_OUTPUT @@ -2006,7 +2006,7 @@ jobs: runs-on: ${{ matrix.runs_on }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_docker + - docker_setup - versioned_source if: | github.event.pull_request.state == 'open' @@ -2016,7 +2016,7 @@ jobs: shell: bash --noprofile --norc -eo pipefail -x {0} strategy: fail-fast: false - matrix: ${{ fromJSON(needs.is_docker.outputs.test_matrix) }} + matrix: ${{ fromJSON(needs.docker_setup.outputs.test_matrix) }} env: DOCKER_BUILDKIT: "1" steps: @@ -2169,10 +2169,10 @@ jobs: fi - name: Write docker bake file run: | - echo '${{ needs.is_docker.outputs.bake_file_json }}' > "${DOCKER_BAKE_FILE}" + echo '${{ needs.docker_setup.outputs.bake_file_json }}' > "${DOCKER_BAKE_FILE}" jq . "${DOCKER_BAKE_FILE}" - name: Write docker compose file - if: needs.is_docker.outputs.has_compose_tests == 'true' + if: needs.docker_setup.outputs.has_compose_tests == 'true' run: | files=" docker-compose.yml @@ -2205,7 +2205,7 @@ jobs: images: | sut localhost:5000/sut - ${{ needs.is_docker.outputs.images_crlf }} + ${{ needs.docker_setup.outputs.images_crlf }} labels: | org.opencontainers.image.version=${{ needs.versioned_source.outputs.semver }} org.opencontainers.image.ref.name=${{ matrix.target }} @@ -2222,7 +2222,7 @@ jobs: uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 with: images: | - ${{ needs.is_docker.outputs.images_crlf }} + ${{ needs.docker_setup.outputs.images_crlf }} tags: | type=raw,value=${{ github.base_ref || github.ref_name }} type=raw,value=${{ github.event.pull_request.head.sha }} @@ -2232,7 +2232,7 @@ jobs: latest=true prefix=${{ steps.strings.outputs.prefix }},onlatest=true suffix=${{ steps.strings.outputs.suffix }},onlatest=true - if: join(fromJSON(needs.is_docker.outputs.images_json)) != '' + if: join(fromJSON(needs.docker_setup.outputs.images_json)) != '' - name: Docker bake id: docker_bake uses: docker/bake-action@017aa056d6bfc9797de5a5dd354a209dc07b490e @@ -2257,7 +2257,7 @@ jobs: load: true provenance: false - name: Save image to file - if: join(fromJSON(needs.is_docker.outputs.images_json)) != '' + if: join(fromJSON(needs.docker_setup.outputs.images_json)) != '' run: | docker save ${{ join(fromJSON(steps.test_meta.outputs.json).tags,' ') }} -o ${DOCKER_TAR} zstd -v ${DOCKER_TAR} @@ -2269,12 +2269,12 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger -v --name-match=kvm - name: Run docker compose tests - if: needs.is_docker.outputs.has_compose_tests == 'true' + if: needs.docker_setup.outputs.has_compose_tests == 'true' run: | docker compose run sut || { docker compose logs ; exit 1 ; } docker compose logs - name: Upload artifacts - if: join(fromJSON(needs.is_docker.outputs.images_json)) != '' + if: join(fromJSON(needs.docker_setup.outputs.images_json)) != '' uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 with: name: docker-${{ matrix.target_slug }}-${{ matrix.platform_slug }} @@ -2286,7 +2286,7 @@ jobs: timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - versioned_source - - is_docker + - docker_setup - npm_test - custom_test - docker_test @@ -2306,7 +2306,7 @@ jobs: - 5000:5000 strategy: fail-fast: false - matrix: ${{ fromJSON(needs.is_docker.outputs.publish_matrix) }} + matrix: ${{ fromJSON(needs.docker_setup.outputs.publish_matrix) }} env: LOCAL_TAG: localhost:5000/sut:latest steps: @@ -2381,7 +2381,7 @@ jobs: with: version: v0.14.0 - name: Warn if tests skipped - if: needs.is_docker.outputs.has_compose_tests != 'true' + if: needs.docker_setup.outputs.has_compose_tests != 'true' run: echo "::warning::Publishing Docker images without docker compose tests!" - name: Download required artifacts uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 @@ -2509,7 +2509,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_docker + - docker_setup - versioned_source if: | github.event.pull_request.merged == true || github.event_name == 'push' @@ -2519,7 +2519,7 @@ jobs: shell: bash --noprofile --norc -eo pipefail -x {0} strategy: fail-fast: false - matrix: ${{ fromJSON(needs.is_docker.outputs.publish_matrix) }} + matrix: ${{ fromJSON(needs.docker_setup.outputs.publish_matrix) }} steps: - name: Generate GitHub App installation token uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a @@ -2713,7 +2713,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_balena + - balena_setup - npm_test - custom_test - docker_test @@ -2722,12 +2722,12 @@ jobs: - versioned_source if: | !failure() && !cancelled() && - needs.is_balena.result == 'success' && + needs.balena_setup.result == 'success' && github.event.pull_request.state == 'open' strategy: fail-fast: false matrix: - slug: ${{ fromJSON(needs.is_balena.outputs.slugs_json) }} + slug: ${{ fromJSON(needs.balena_setup.outputs.slugs_json) }} defaults: run: working-directory: ${{ inputs.working_directory }} @@ -2802,14 +2802,14 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_balena + - balena_setup - versioned_source if: | github.event.pull_request.merged == true || github.event_name == 'push' strategy: fail-fast: false matrix: - slug: ${{ fromJSON(needs.is_balena.outputs.slugs_json) }} + slug: ${{ fromJSON(needs.balena_setup.outputs.slugs_json) }} defaults: run: working-directory: ${{ inputs.working_directory }} @@ -2880,11 +2880,11 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_python + - python_setup - versioned_source if: | github.event.pull_request.state == 'open' && - needs.is_python.outputs.is_poetry == 'true' + needs.python_setup.outputs.is_poetry == 'true' defaults: run: working-directory: ${{ inputs.working_directory }} @@ -2892,7 +2892,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ${{ fromJSON(needs.is_python.outputs.versions_json) }} + python-version: ${{ fromJSON(needs.python_setup.outputs.versions_json) }} steps: - name: Generate GitHub App installation token uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a @@ -2963,7 +2963,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_python + - python_setup - npm_test - custom_test - docker_test @@ -2973,8 +2973,8 @@ jobs: if: | !failure() && !cancelled() && needs.python_test.result == 'success' && - needs.is_python.outputs.is_poetry == 'true' && - needs.is_python.outputs.pypi_publish == 'true' + needs.python_setup.outputs.is_poetry == 'true' && + needs.python_setup.outputs.pypi_publish == 'true' defaults: run: working-directory: ${{ inputs.working_directory }} @@ -3043,12 +3043,12 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_python + - python_setup - versioned_source if: | (github.event.pull_request.merged == true || github.event_name == 'push') && - needs.is_python.outputs.is_poetry == 'true' && - needs.is_python.outputs.pypi_publish == 'true' + needs.python_setup.outputs.is_poetry == 'true' && + needs.python_setup.outputs.pypi_publish == 'true' defaults: run: working-directory: ${{ inputs.working_directory }} @@ -3431,7 +3431,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cargo + - cargo_setup - versioned_source if: | github.event.pull_request.state == 'open' @@ -3442,7 +3442,7 @@ jobs: strategy: fail-fast: false matrix: - target: ${{ fromJSON(needs.is_cargo.outputs.targets_json) }} + target: ${{ fromJSON(needs.cargo_setup.outputs.targets_json) }} outputs: package: ${{ steps.meta.outputs.package }} version: ${{ steps.meta.outputs.version }} @@ -3508,7 +3508,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cargo + - cargo_setup - npm_test - custom_test - docker_test @@ -3526,7 +3526,7 @@ jobs: strategy: fail-fast: false matrix: - target: ${{ fromJSON(needs.is_cargo.outputs.targets_json) }} + target: ${{ fromJSON(needs.cargo_setup.outputs.targets_json) }} steps: - name: Generate GitHub App installation token uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a @@ -3580,7 +3580,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cargo + - cargo_setup - versioned_source if: github.event.pull_request.merged == true || github.event_name == 'push' defaults: @@ -3920,15 +3920,15 @@ jobs: strategy: fail-fast: true matrix: - stack: ${{ fromJSON(needs.is_cloudformation.outputs.stacks) }} - include: ${{ fromJSON(needs.is_cloudformation.outputs.includes) }} + stack: ${{ fromJSON(needs.cloudformation_setup.outputs.stacks) }} + include: ${{ fromJSON(needs.cloudformation_setup.outputs.includes) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cloudformation + - cloudformation_setup - versioned_source if: | github.event.pull_request.state == 'open' && - needs.is_cloudformation.outputs.is_valid == 'true' + needs.cloudformation_setup.outputs.is_valid == 'true' defaults: run: working-directory: ${{ inputs.working_directory }} @@ -4207,14 +4207,14 @@ jobs: strategy: fail-fast: false matrix: - stack: ${{ fromJSON(needs.is_cloudformation.outputs.stacks) }} - include: ${{ fromJSON(needs.is_cloudformation.outputs.includes) }} + stack: ${{ fromJSON(needs.cloudformation_setup.outputs.stacks) }} + include: ${{ fromJSON(needs.cloudformation_setup.outputs.includes) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cloudformation + - cloudformation_setup if: | (github.event.pull_request.merged == true || github.event_name == 'push') && - needs.is_cloudformation.outputs.is_valid == 'true' + needs.cloudformation_setup.outputs.is_valid == 'true' env: AWS_RETRY_MODE: adaptive AWS_MAX_ATTEMPTS: 10 @@ -4374,11 +4374,11 @@ jobs: - event_types - versioned_source - process_files - - is_npm - - is_docker - - is_python - - is_cargo - - is_balena + - npm_setup + - docker_setup + - python_setup + - cargo_setup + - balena_setup - custom_test_setup - custom_publish_setup - custom_finalize_setup diff --git a/flowzone.yml b/flowzone.yml index 1fcdc7da3..6ac721b60 100644 --- a/flowzone.yml +++ b/flowzone.yml @@ -360,7 +360,7 @@ images: | sut localhost:5000/sut - ${{ needs.is_docker.outputs.images_crlf }} + ${{ needs.docker_setup.outputs.images_crlf }} labels: | org.opencontainers.image.version=${{ needs.versioned_source.outputs.semver }} org.opencontainers.image.ref.name=${{ matrix.target }} @@ -377,10 +377,10 @@ <<: *dockerTestMetadata id: cache_meta # ensure images_crlf is not an empty list - if: join(fromJSON(needs.is_docker.outputs.images_json)) != '' + if: join(fromJSON(needs.docker_setup.outputs.images_json)) != '' with: images: | - ${{ needs.is_docker.outputs.images_crlf }} + ${{ needs.docker_setup.outputs.images_crlf }} tags: | type=raw,value=${{ github.base_ref || github.ref_name }} type=raw,value=${{ github.event.pull_request.head.sha }} @@ -544,7 +544,7 @@ name: Sort node versions id: node_versions env: - VERSIONS: ${{ needs.is_npm.outputs.node_versions }} + VERSIONS: ${{ needs.npm_setup.outputs.node_versions }} run: | echo "min=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort | head -n1)" >> $GITHUB_OUTPUT echo "max=$(echo "${VERSIONS}" | jq -r '.[]' | sort --version-sort --reverse | head -n1)" >> $GITHUB_OUTPUT @@ -1245,7 +1245,7 @@ jobs: echo "json=$(git ls-files | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT # check if the repository has a package.json file and which engine versions are supported - is_npm: + npm_setup: name: Setup npm runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -1332,7 +1332,7 @@ jobs: fi # pre-process any docker-compose and docker-bake files - is_docker: + docker_setup: name: Setup docker runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -1524,7 +1524,7 @@ jobs: echo "build=${matrix}">> $GITHUB_OUTPUT - is_python: + python_setup: name: Setup python env: SUPPORTED_VERSIONS: | @@ -1592,7 +1592,7 @@ jobs: echo "json=${PYTHON_VERSIONS}" >> $GITHUB_OUTPUT fi - is_cargo: + cargo_setup: name: Setup rust runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -1617,7 +1617,7 @@ jobs: INPUT: ${{ inputs.cargo_targets }} DELIMITER: "," - is_balena: + balena_setup: name: Setup balena runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -1703,7 +1703,7 @@ jobs: env: MATRIX_INPUT: '' - is_cloudformation: + cloudformation_setup: name: Setup CloudFormation runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} @@ -1762,7 +1762,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_npm + - npm_setup - versioned_source if: | github.event.pull_request.state == 'open' @@ -1772,7 +1772,7 @@ jobs: strategy: fail-fast: false matrix: - node_version: ${{ fromJSON(needs.is_npm.outputs.node_versions) }} + node_version: ${{ fromJSON(needs.npm_setup.outputs.node_versions) }} outputs: package: ${{ steps.meta.outputs.package }} @@ -1788,14 +1788,14 @@ jobs: - *sortNodeVersions - <<: *setupNode - if: needs.is_npm.outputs.has_lockfile == 'true' + if: needs.npm_setup.outputs.has_lockfile == 'true' with: node-version: "${{ matrix.node_version }}" registry-url: "${{ env.NPM_REGISTRY }}" cache: "npm" - <<: *setupNode - if: needs.is_npm.outputs.has_lockfile != 'true' + if: needs.npm_setup.outputs.has_lockfile != 'true' with: node-version: "${{ matrix.node_version }}" registry-url: "${{ env.NPM_REGISTRY }}" @@ -1832,7 +1832,7 @@ jobs: index="$(jq --arg os "${runner_os}" '.os | index($os) | select( . != null )' package.json)" if [[ -n "$index" ]] || [[ "$os_count" -lt 1 ]]; then - if [ ${{ needs.is_npm.outputs.has_lockfile }} == 'true' ]; then + if [ ${{ needs.npm_setup.outputs.has_lockfile }} == 'true' ]; then npm ci else npm i @@ -1854,7 +1854,7 @@ jobs: run: npm test - name: Run pack - if: needs.is_npm.outputs.is_private != 'true' && steps.node_versions.outputs.max == matrix.node_version + if: needs.npm_setup.outputs.is_private != 'true' && steps.node_versions.outputs.max == matrix.node_version run: | mkdir ${{ runner.temp }}/npm-pack && npm pack --pack-destination=${{ runner.temp }}/npm-pack @@ -1862,7 +1862,7 @@ jobs: [[ "$(npm --version)" =~ ^6\..* ]] && find . -maxdepth 1 -name '*.tgz' -exec mv {} ${{ runner.temp }}/npm-pack \; || true - name: Upload artifact - if: needs.is_npm.outputs.is_private != 'true' && steps.node_versions.outputs.max == matrix.node_version + if: needs.npm_setup.outputs.is_private != 'true' && steps.node_versions.outputs.max == matrix.node_version uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: npm-${{ github.event.pull_request.head.sha }}-${{ matrix.node_version }} @@ -1870,16 +1870,16 @@ jobs: retention-days: 90 - name: Generate docs (if present) - if: needs.is_npm.outputs.has_docs == 'true' + if: needs.npm_setup.outputs.has_docs == 'true' shell: bash run: npm run doc - name: Compress docs - if: needs.is_npm.outputs.has_docs == 'true' && steps.node_versions.outputs.max == matrix.node_version + if: needs.npm_setup.outputs.has_docs == 'true' && steps.node_versions.outputs.max == matrix.node_version run: tar --auto-compress -cvf ${{ runner.temp }}/docs.tar.zst ./docs - name: Upload artifact - if: needs.is_npm.outputs.has_docs == 'true' && steps.node_versions.outputs.max == matrix.node_version + if: needs.npm_setup.outputs.has_docs == 'true' && steps.node_versions.outputs.max == matrix.node_version uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: docs-${{ github.event.pull_request.head.sha }}-${{ matrix.node_version }} @@ -1891,7 +1891,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_npm + - npm_setup - npm_test - custom_test - docker_test @@ -1901,7 +1901,7 @@ jobs: if: | !failure() && !cancelled() && needs.npm_test.result == 'success' && - needs.is_npm.outputs.is_private != 'true' + needs.npm_setup.outputs.is_private != 'true' <<: *rootWorkingDirectory @@ -1940,7 +1940,7 @@ jobs: if [ ${{ github.run_attempt }} -gt 1 ]; then npm --loglevel=verbose --logs-max=0 unpublish ${{ needs.npm_test.outputs.package }}@${{ needs.npm_test.outputs.version_tag }}-$((${{ github.run_attempt }} - 1)) || true fi - npm --loglevel=verbose --logs-max=0 publish --tag=${{ needs.npm_test.outputs.sha_tag }} "${pack}" --access="${{ needs.is_npm.outputs.npm_access }}" + npm --loglevel=verbose --logs-max=0 publish --tag=${{ needs.npm_test.outputs.sha_tag }} "${pack}" --access="${{ needs.npm_setup.outputs.npm_access }}" npm --loglevel=verbose --logs-max=0 dist-tag add ${{ needs.npm_test.outputs.package }}@${{ needs.npm_test.outputs.version_tag }}-${{ github.run_attempt }} ${{ needs.npm_test.outputs.branch_tag }} npm_finalize: @@ -1948,10 +1948,10 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_npm + - npm_setup if: | (github.event.pull_request.merged == true || github.event_name == 'push') && - needs.is_npm.outputs.is_private != 'true' + needs.npm_setup.outputs.is_private != 'true' <<: *rootWorkingDirectory @@ -1984,17 +1984,17 @@ jobs: run: | npm config set ignore-scripts true pack="$(ls ${{ runner.temp }}/*.tgz | sort -t- -n -k3 | tail -n1)" - npm --loglevel=verbose --logs-max=0 publish --tag "latest" "${pack}" --access="${{ needs.is_npm.outputs.npm_access }}" + npm --loglevel=verbose --logs-max=0 publish --tag "latest" "${pack}" --access="${{ needs.npm_setup.outputs.npm_access }}" npm_docs_finalize: name: Finalize npm docs runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_npm + - npm_setup if: | (github.event.pull_request.merged == true || github.event_name == 'push') && - needs.is_npm.outputs.has_docs == 'true' + needs.npm_setup.outputs.has_docs == 'true' <<: *rootWorkingDirectory @@ -2044,7 +2044,7 @@ jobs: runs-on: ${{ matrix.runs_on }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_docker + - docker_setup - versioned_source if: | github.event.pull_request.state == 'open' @@ -2053,7 +2053,7 @@ jobs: strategy: fail-fast: false - matrix: ${{ fromJSON(needs.is_docker.outputs.test_matrix) }} + matrix: ${{ fromJSON(needs.docker_setup.outputs.test_matrix) }} env: DOCKER_BUILDKIT: "1" @@ -2115,11 +2115,11 @@ jobs: - name: Write docker bake file run: | - echo '${{ needs.is_docker.outputs.bake_file_json }}' > "${DOCKER_BAKE_FILE}" + echo '${{ needs.docker_setup.outputs.bake_file_json }}' > "${DOCKER_BAKE_FILE}" jq . "${DOCKER_BAKE_FILE}" - name: Write docker compose file - if: needs.is_docker.outputs.has_compose_tests == 'true' + if: needs.docker_setup.outputs.has_compose_tests == 'true' run: | files=" docker-compose.yml @@ -2176,7 +2176,7 @@ jobs: # save image to file before running compose tests to avoid tainting the published image - name: Save image to file - if: join(fromJSON(needs.is_docker.outputs.images_json)) != '' + if: join(fromJSON(needs.docker_setup.outputs.images_json)) != '' run: | docker save ${{ join(fromJSON(steps.test_meta.outputs.json).tags,' ') }} -o ${DOCKER_TAR} zstd -v ${DOCKER_TAR} @@ -2195,14 +2195,14 @@ jobs: # run docker compose tests and print the logs from all services - name: Run docker compose tests - if: needs.is_docker.outputs.has_compose_tests == 'true' + if: needs.docker_setup.outputs.has_compose_tests == 'true' run: | docker compose run sut || { docker compose logs ; exit 1 ; } docker compose logs # https://github.com/actions/upload-artifact - name: Upload artifacts - if: join(fromJSON(needs.is_docker.outputs.images_json)) != '' + if: join(fromJSON(needs.docker_setup.outputs.images_json)) != '' uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: # this docker-{sha}-{target}-{platform} naming scheme is used by docker_publish to find the correct artifact @@ -2216,7 +2216,7 @@ jobs: timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - versioned_source - - is_docker + - docker_setup - npm_test - custom_test - docker_test @@ -2237,7 +2237,7 @@ jobs: strategy: fail-fast: false - matrix: ${{ fromJSON(needs.is_docker.outputs.publish_matrix) }} + matrix: ${{ fromJSON(needs.docker_setup.outputs.publish_matrix) }} env: LOCAL_TAG: localhost:5000/sut:latest @@ -2249,7 +2249,7 @@ jobs: - *setupCrane - name: Warn if tests skipped - if: needs.is_docker.outputs.has_compose_tests != 'true' + if: needs.docker_setup.outputs.has_compose_tests != 'true' run: echo "::warning::Publishing Docker images without docker compose tests!" # https://github.com/actions/download-artifact @@ -2338,7 +2338,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_docker + - docker_setup - versioned_source if: | github.event.pull_request.merged == true || github.event_name == 'push' @@ -2347,7 +2347,7 @@ jobs: strategy: fail-fast: false - matrix: ${{ fromJSON(needs.is_docker.outputs.publish_matrix) }} + matrix: ${{ fromJSON(needs.docker_setup.outputs.publish_matrix) }} steps: - *getGitHubAppToken @@ -2395,7 +2395,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_balena + - balena_setup - npm_test - custom_test - docker_test @@ -2405,13 +2405,13 @@ jobs: # allow some dependencies to be skipped if: | !failure() && !cancelled() && - needs.is_balena.result == 'success' && + needs.balena_setup.result == 'success' && github.event.pull_request.state == 'open' strategy: fail-fast: false matrix: - slug: ${{ fromJSON(needs.is_balena.outputs.slugs_json) }} + slug: ${{ fromJSON(needs.balena_setup.outputs.slugs_json) }} <<: *customWorkingDirectory @@ -2427,7 +2427,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_balena + - balena_setup - versioned_source if: | github.event.pull_request.merged == true || github.event_name == 'push' @@ -2435,7 +2435,7 @@ jobs: strategy: fail-fast: false matrix: - slug: ${{ fromJSON(needs.is_balena.outputs.slugs_json) }} + slug: ${{ fromJSON(needs.balena_setup.outputs.slugs_json) }} <<: *customWorkingDirectory @@ -2456,18 +2456,18 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_python + - python_setup - versioned_source if: | github.event.pull_request.state == 'open' && - needs.is_python.outputs.is_poetry == 'true' + needs.python_setup.outputs.is_poetry == 'true' <<: *customWorkingDirectory strategy: fail-fast: false matrix: - python-version: ${{ fromJSON(needs.is_python.outputs.versions_json) }} + python-version: ${{ fromJSON(needs.python_setup.outputs.versions_json) }} steps: - *getGitHubAppToken @@ -2520,7 +2520,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_python + - python_setup - npm_test - custom_test - docker_test @@ -2531,8 +2531,8 @@ jobs: if: | !failure() && !cancelled() && needs.python_test.result == 'success' && - needs.is_python.outputs.is_poetry == 'true' && - needs.is_python.outputs.pypi_publish == 'true' + needs.python_setup.outputs.is_poetry == 'true' && + needs.python_setup.outputs.pypi_publish == 'true' <<: *customWorkingDirectory @@ -2564,12 +2564,12 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_python + - python_setup - versioned_source if: | (github.event.pull_request.merged == true || github.event_name == 'push') && - needs.is_python.outputs.is_poetry == 'true' && - needs.is_python.outputs.pypi_publish == 'true' + needs.python_setup.outputs.is_poetry == 'true' && + needs.python_setup.outputs.pypi_publish == 'true' <<: *customWorkingDirectory steps: @@ -2799,7 +2799,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cargo + - cargo_setup - versioned_source if: | github.event.pull_request.state == 'open' @@ -2809,7 +2809,7 @@ jobs: strategy: fail-fast: false matrix: - target: ${{ fromJSON(needs.is_cargo.outputs.targets_json) }} + target: ${{ fromJSON(needs.cargo_setup.outputs.targets_json) }} outputs: package: ${{ steps.meta.outputs.package }} @@ -2862,7 +2862,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cargo + - cargo_setup - npm_test - custom_test - docker_test @@ -2880,7 +2880,7 @@ jobs: strategy: fail-fast: false matrix: - target: ${{ fromJSON(needs.is_cargo.outputs.targets_json) }} + target: ${{ fromJSON(needs.cargo_setup.outputs.targets_json) }} steps: - *getGitHubAppToken @@ -2921,7 +2921,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cargo + - cargo_setup - versioned_source if: github.event.pull_request.merged == true || github.event_name == 'push' @@ -3165,15 +3165,15 @@ jobs: strategy: fail-fast: true matrix: - stack: ${{ fromJSON(needs.is_cloudformation.outputs.stacks) }} - include: ${{ fromJSON(needs.is_cloudformation.outputs.includes) }} + stack: ${{ fromJSON(needs.cloudformation_setup.outputs.stacks) }} + include: ${{ fromJSON(needs.cloudformation_setup.outputs.includes) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cloudformation + - cloudformation_setup - versioned_source if: | github.event.pull_request.state == 'open' && - needs.is_cloudformation.outputs.is_valid == 'true' + needs.cloudformation_setup.outputs.is_valid == 'true' <<: *customWorkingDirectory @@ -3380,14 +3380,14 @@ jobs: strategy: fail-fast: false matrix: - stack: ${{ fromJSON(needs.is_cloudformation.outputs.stacks) }} - include: ${{ fromJSON(needs.is_cloudformation.outputs.includes) }} + stack: ${{ fromJSON(needs.cloudformation_setup.outputs.stacks) }} + include: ${{ fromJSON(needs.cloudformation_setup.outputs.includes) }} timeout-minutes: ${{ fromJSON(inputs.jobs_timeout_minutes) }} needs: - - is_cloudformation + - cloudformation_setup if: | (github.event.pull_request.merged == true || github.event_name == 'push') && - needs.is_cloudformation.outputs.is_valid == 'true' + needs.cloudformation_setup.outputs.is_valid == 'true' env: # https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-retries.html#cli-usage-retries-modes-adaptive @@ -3454,11 +3454,11 @@ jobs: - event_types - versioned_source - process_files - - is_npm - - is_docker - - is_python - - is_cargo - - is_balena + - npm_setup + - docker_setup + - python_setup + - cargo_setup + - balena_setup - custom_test_setup - custom_publish_setup - custom_finalize_setup