Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions .github/workflows/pull-request-conditionals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ name: Filter
# This workflow is triggered on pull requests
on:
pull_request:
branches: [main]
# milestoned is added here as a workaround for release-please not triggering PR workflows (PRs should be added to a milestone to trigger the workflow).
branches:
- main
- "release/**" # milestoned is added here as a workaround for release-please not triggering PR workflows (PRs should be added to a milestone to trigger the workflow).
# labeled is added to support renovate-ready labelling on PRs
types: [milestoned, labeled, opened, reopened, synchronize]
paths-ignore:
Expand Down Expand Up @@ -87,6 +88,7 @@ jobs:
outputs:
combined: ${{ steps.combine-path-filters.outputs.combined }}
distros: ${{ steps.path-filter-iac.outputs.changes }}
run_full_tests: ${{ steps.test-routing.outputs.run_full_tests }}

steps:
- name: Checkout the code
Expand Down Expand Up @@ -131,11 +133,32 @@ jobs:
echo combined=$COMBINED >> $GITHUB_OUTPUT
echo The following packages will be triggered: $COMBINED

- name: Compute test routing
id: test-routing
run: |
BASE="${{ github.base_ref }}"
HEAD="${{ github.head_ref }}"
COMBINED='${{ steps.combine-path-filters.outputs.combined }}'

RUN_FULL=false

if [[ -n "$COMBINED" && "$COMBINED" != "[]" ]]; then
if [[ "$BASE" == "main" ]]; then
RUN_FULL=true
elif [[ "$BASE" == release/* ]]; then
if [[ "$HEAD" == release-please* ]]; then
RUN_FULL=true
fi
fi
fi

echo "run_full_tests=$RUN_FULL" >> $GITHUB_OUTPUT

# @lulaStart 11948466-9230-4498-be44-dbac784d86d1
# This job triggers a separate workflow for each changed source package, if any.
run-package-test:
needs: check-paths
if: ${{ needs.check-paths.outputs.combined != '' && needs.check-paths.outputs.combined != '[]' }}
if: ${{ needs.check-paths.outputs.run_full_tests == 'true' }}
name: Schedule
strategy:
matrix:
Expand All @@ -148,4 +171,21 @@ jobs:
flavor: ${{ matrix.flavor }}
test_type: ${{ matrix.test_type }}
secrets: inherit # Inherits all secrets from the parent workflow.
# @lulaEnd 11948466-9230-4498-be44-dbac784d86d1
# @lulaEnd 11948466-9230-4498-be44-dbac784d86d1

# Shim out required heavy tests for non-release-please PRs to release/*.
run-package-test-shim:
needs: check-paths
if: ${{ needs.check-paths.outputs.run_full_tests != 'true' }}
name: Schedule
strategy:
matrix:
package: [all]
flavor: [upstream, registry1, unicorn]
test_type: [install, upgrade]
uses: ./.github/workflows/test-shim.yaml
with:
package: ${{ matrix.package }}
flavor: ${{ matrix.flavor }}
test_type: ${{ matrix.test_type }}
secrets: inherit
99 changes: 0 additions & 99 deletions .github/workflows/pull-request-release.yaml

This file was deleted.

59 changes: 0 additions & 59 deletions .github/workflows/release-patch.yaml

This file was deleted.

10 changes: 7 additions & 3 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
push:
branches:
- main
- "release/**"

jobs:
# @lulaStart d364a8e6-95ab-448c-bb97-9f456c85b54f
Expand All @@ -27,6 +28,9 @@ jobs:
- name: Create release tag
id: tag
uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
with:
target-branch: ${{ github.ref_name }}
config-file: ${{ startsWith(github.ref, 'refs/heads/release/') && 'release-please-config.patch.json' || 'release-please-config.json' }}

publish-uds-core-release:
needs: tag-new-version
Expand All @@ -43,7 +47,7 @@ jobs:

scan-release:
needs: publish-uds-core-release
if: ${{ github.repository_owner == 'defenseunicorns' }}
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
contents: read
packages: read
Expand All @@ -66,8 +70,8 @@ jobs:
secrets: inherit

cut-release-branch:
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true' }}
needs: publish-uds-core-release
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
Loading
Loading