Skip to content

Commit

Permalink
Updates branch build input menu
Browse files Browse the repository at this point in the history
  • Loading branch information
apbassett committed Nov 13, 2023
1 parent b3504c7 commit 67e630d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
43 changes: 29 additions & 14 deletions .github/workflows/create-branch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ run-name: "Branch Build (${{ github.run_attempt }}.${{ github.run_number }}) - $
on:
workflow_dispatch:
inputs:
payload:
amalgam-build:
description: |
JSON payload containing extra info used by workflow.
For builds that have dependencies, key values of 'repo' => 'build-id' may
be used to define version. If blank or not supplied, latest tagged release
build will be used. Build ID may also be a release tag version.
Example:
{
"amalgam": "6191984493",
"howso-engine": "68.1.0"
}
(Optional) amalgam build or version number. Defaults to latest release.
Examples:
'6807310618',
'https://github.com/howsoai/amalgam/actions/runs/6807310618',
'68.0.1'
required: false
type: string

Expand Down Expand Up @@ -58,13 +53,33 @@ jobs:
BRANCH_ITERATION=${{ github.run_attempt }}.${{ github.run_number }}
echo "version=$(echo ${{ steps.next-semvers.outputs.patch }}-alpha+BR.${{ github.ref_name }}.${BRANCH_ITERATION})" >> $GITHUB_OUTPUT
construct-payload:
runs-on: ubuntu-latest
outputs:
payload: ${{ steps.construct-payload.outputs.payload }}
steps:

- name: Construct payload
id: construct-payload
run: |
payload="{}"
# Get amalgam version or run ID
if [[ "${{ inputs.amalgam-build }}" =~ runs/([0-9]+) ]]; then
payload=$(echo "$payload" | jq --arg run_id "${BASH_REMATCH[1]}" '. + {"amalgam-lang-py": $run_id}')
elif [[ -n "${{ inputs.amalgam-build }}" ]]; then
payload=$(echo "$payload" | jq --arg run_id "${{ inputs.amalgam-build }}" '. + {"amalgam-lang-py": $run_id}')
fi
echo "$payload"
fmtd_payload=$(echo -n "$payload" | tr -d '\n')
echo "payload=$fmtd_payload" >> $GITHUB_OUTPUT
build:
needs: ['set-branch-version']
needs: ['set-branch-version', 'construct-payload']
uses: "./.github/workflows/build.yml"
secrets: inherit
with:
version: ${{ needs.set-branch-version.outputs.version }}
payload: ${{ inputs.payload }}
payload: ${{ needs.construct-payload.outputs.payload }}
build-type: 'branch'

# This job is here to have only one final step to add for "Status Checks"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
pip install -e ".[dev]"
loglevel=${1:-INFO}
source_root_dir="amalgam"
pip list
pytest -s --log-cli-level=${loglevel} -o junit_family=xunit2 --cov-report term --cov=${source_root_dir} --junitxml=junit/test-results.xml --cov-report=xml
- name: Run flake8 linter
Expand Down

0 comments on commit 67e630d

Please sign in to comment.