Skip to content

Commit

Permalink
18744: Upgrades Actions workflows to centralized versions (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: howso-automation <support@howso.com>
  • Loading branch information
apbassett and howso-automation authored Jan 12, 2024
1 parent 36729f8 commit c584b08
Show file tree
Hide file tree
Showing 19 changed files with 24,614 additions and 635 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build PR
run-name: "PR Build: #${{ github.event.pull_request.number }} (${{ github.run_attempt }}.${{ github.run_number }}) - ${{ github.event.pull_request.title }}"

on:
pull_request:
branches:
- "main"

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

gen-requirements:
uses: "howsoai/.github/.github/workflows/compile-requirements.yml@main"
secrets: inherit
with:
upstream-packages: 'amalgam-lang-py howso-engine-py'

build:
needs: ['gen-requirements']
uses: "./.github/workflows/build.yml"
secrets: inherit
with:
build-type: "PR"

xray:
needs: ['build']
uses: "howsoai/.github/.github/workflows/scan-pull-request.yml@main"
secrets: inherit
with:
upstream-packages: 'amalgam-lang-py howso-engine-py'

# This job is here to have only one final step to add for "Status Checks"
# in GitHub, instead of adding every leaf test from 'build-test-package'
final-check:
needs: ['build', 'gen-requirements', 'xray']
if: always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))
runs-on: ubuntu-latest
steps:
- run: exit 1
26 changes: 26 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Release
run-name: "Release Build"

on:
workflow_dispatch:
inputs:
optional-release-tag:
description: "Optional release tag (if empty, will search previous commit titles for MAJOR/MINOR and autoincrement latest tag accordingly)"
required: false

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

release:
uses: "./.github/workflows/build.yml"
secrets: inherit
with:
build-type: "release"
optional-release-tag: ${{ inputs.optional-release-tag }}
145 changes: 130 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,164 @@
name: Reusable WF - Build
name: Build
run-name: "Branch Build (${{ github.run_attempt }}.${{ github.run_number }}) - ${{ github.ref_name }}"

on:
workflow_call:
workflow_dispatch:
inputs:
version:
required: true
amalgam-lang-py-build:
description: |
(Optional) amalgam-lang-py build or version number. Defaults to pinned release.
Examples:
'6807310618',
'https://github.com/howsoai/amalgam-lang-py/actions/runs/6807310618',
'4.0.1'
required: false
type: string
payload:
howso-engine-py-build:
description: |
(Optional) howso-engine-py build or version number. Defaults to pinned release.
required: false
type: string
workflow_call:
inputs:
build-type:
required: false
type: string
optional-release-tag:
required: false
type: string

defaults:
run:
shell: bash

jobs:

metadata:
uses: howsoai/.github/.github/workflows/set-metadata.yml@main
secrets: inherit
with:
# Remove unused parameters
build-type: ${{ inputs.build-type }}
optional-release-tag: ${{ inputs.optional-release-tag }}
amalgam-lang-py-build: ${{ inputs.amalgam-lang-py-build }}
howso-engine-py-build: ${{ inputs.howso-engine-py-build }}

workflow-summary:
if: inputs.build-type != 'release'
uses: "./.github/workflows/workflow-summary.yml"
needs: ['metadata']
uses: "howsoai/.github/.github/workflows/workflow-summary.yml@main"
secrets: inherit
with:
upstream-details: ${{ needs.metadata.outputs.upstream-details }}

pytest-linux-3-8-st:
if: inputs.build-type != 'PR'
needs: ['metadata']
uses: howsoai/.github/.github/workflows/pytest.yml@main
secrets: inherit
with:
platform: 'howso-ubuntu-runner-latest'
platform-pretty: 'Linux'
amalgam-plat-arch: 'linux-amd64'
python-version: '3.8'
config-fp: './config/latest-st-debug-howso.yml'
config-pretty: 'ST'
workers: 'auto'
upstream-details: ${{ needs.metadata.outputs.upstream-details }}

pytest-linux-3-9-st:
if: inputs.build-type != 'PR'
needs: ['metadata']
uses: howsoai/.github/.github/workflows/pytest.yml@main
secrets: inherit
with:
platform: 'howso-ubuntu-runner-latest'
platform-pretty: 'Linux'
amalgam-plat-arch: 'linux-amd64'
python-version: '3.9'
config-fp: './config/latest-st-debug-howso.yml'
config-pretty: 'ST'
workers: 'auto'
upstream-details: ${{ needs.metadata.outputs.upstream-details }}

pytest-linux-3-10-st:
if: inputs.build-type != 'PR'
needs: ['metadata']
uses: howsoai/.github/.github/workflows/pytest.yml@main
secrets: inherit
with:
platform: 'howso-ubuntu-runner-latest'
platform-pretty: 'Linux'
amalgam-plat-arch: 'linux-amd64'
python-version: '3.10'
config-fp: './config/latest-st-debug-howso.yml'
config-pretty: 'ST'
workers: 'auto'
upstream-details: ${{ needs.metadata.outputs.upstream-details }}

pytest-linux-3-11-mt:
if: inputs.build-type != 'PR'
needs: ['metadata']
uses: howsoai/.github/.github/workflows/pytest.yml@main
secrets: inherit
with:
platform: 'howso-ubuntu-runner-latest'
platform-pretty: 'Linux'
amalgam-plat-arch: 'linux-amd64'
python-version: '3.11'
config-fp: './config/latest-mt-debug-howso.yml'
config-pretty: 'MT'
upstream-details: ${{ needs.metadata.outputs.upstream-details }}

pytest-windows-3-11-mt:
if: inputs.build-type != 'PR'
needs: ['metadata']
uses: howsoai/.github/.github/workflows/pytest.yml@main
secrets: inherit
with:
payload: "${{ inputs.payload }}"
platform: 'howso-windows-runner-latest'
platform-pretty: 'Windows'
amalgam-plat-arch: 'windows-amd64'
python-version: '3.11'
config-fp: './config/latest-mt-debug-howso.yml'
config-pretty: 'MT'
upstream-details: ${{ needs.metadata.outputs.upstream-details }}

test:
if: inputs.build-type != 'release'
uses: "./.github/workflows/pytest.yml"
pytest-macos-3-11-mt:
if: inputs.build-type != 'PR'
needs: ['metadata']
uses: howsoai/.github/.github/workflows/pytest.yml@main
secrets: inherit
with:
payload: "${{ inputs.payload }}"
platform: 'macos-latest-xlarge'
platform-pretty: 'MacOS'
amalgam-plat-arch: 'darwin-arm64'
python-version: '3.11'
config-fp: './config/latest-mt-debug-howso.yml'
config-pretty: 'MT'
upstream-details: ${{ needs.metadata.outputs.upstream-details }}

create-release:
release:
needs:
- metadata
- pytest-linux-3-8-st
- pytest-linux-3-9-st
- pytest-linux-3-10-st
- pytest-linux-3-11-mt
- pytest-windows-3-11-mt
- pytest-macos-3-11-mt
if: inputs.build-type == 'release'
permissions:
contents: write
runs-on: ubuntu-latest
steps:

- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ inputs.version }}
tag: ${{ needs.metadata.outputs.version }}
commit: ${{ github.sha }}
name: "Howso Engine Recipes ${{ inputs.version }}"
name: "${{ github.event.repository.name }} ${{ needs.metadata.outputs.version }}"
artifactErrorsFailBuild: true
generateReleaseNotes: true
makeLatest: legacy
77 changes: 0 additions & 77 deletions .github/workflows/create-branch-build.yml

This file was deleted.

Loading

0 comments on commit c584b08

Please sign in to comment.