Skip to content

Commit

Permalink
Merge branch 'main' into certified_data_prop_test
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Dec 10, 2024
2 parents c20e273 + 5d264b8 commit f9c62ab
Show file tree
Hide file tree
Showing 14 changed files with 9,668 additions and 43,972 deletions.
23 changes: 23 additions & 0 deletions .github/actions/determine_exclusions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Example Usage

```yaml
steps:
- uses: actions/checkout@v4

- id: determine-exclusions
uses: ./.github/actions/determine_exclusions
with:
is_workflow_dispatch: ${{ github.event_name == 'workflow_dispatch' }}
exclude_slow_input: ${{ inputs.exclude-slow-tests }}
exclude_unstable_input: ${{ inputs.exclude-unstable-tests }}
exclude_release_only_input: ${{ inputs.exclude-release-only-tests }}
is_feature_branch_draft_pr: ${{ steps.set-conditions.outputs.is_feature_branch_draft_pr }}
is_feature_branch_pr: ${{ steps.set-conditions.outputs.is_feature_branch_pr }}
is_main_branch_push: ${{ steps.set-conditions.outputs.is_main_branch_push }}

- name: Use exclusion outputs
run: |
echo "Exclude slow tests: ${{ steps.determine-exclusions.outputs.exclude_slow }}"
echo "Exclude unstable tests: ${{ steps.determine-exclusions.outputs.exclude_unstable }}"
echo "Exclude release only tests: ${{ steps.determine-exclusions.outputs.exclude_release_only }}"
```
56 changes: 56 additions & 0 deletions .github/actions/determine_exclusions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'Determine Test Exclusions'
description: 'Determines which tests should be excluded based on workflow trigger and conditions'

inputs:
is_workflow_dispatch:
description: 'Whether this is a workflow dispatch run'
required: true
exclude_slow_input:
description: 'Workflow dispatch input for excluding slow tests'
required: true
exclude_unstable_input:
description: 'Workflow dispatch input for excluding unstable tests'
required: true
exclude_release_only_input:
description: 'Workflow dispatch input for excluding release only tests'
required: true
is_feature_branch_draft_pr:
description: 'Whether this is a draft PR'
required: true
is_feature_branch_pr:
description: 'Whether this is a feature branch PR'
required: true
is_main_branch_push:
description: 'Whether this is a push to main'
required: true

outputs:
exclude_slow:
description: 'Whether to exclude slow tests'
value: ${{ steps.determine.outputs.exclude_slow }}
exclude_unstable:
description: 'Whether to exclude unstable tests'
value: ${{ steps.determine.outputs.exclude_unstable }}
exclude_release_only:
description: 'Whether to exclude release only tests'
value: ${{ steps.determine.outputs.exclude_release_only }}

runs:
using: 'composite'
steps:
- id: determine
shell: bash
run: |
if [[ "${{ inputs.is_workflow_dispatch }}" == "true" ]]; then
echo "exclude_slow=${{ inputs.exclude_slow_input }}" >> $GITHUB_OUTPUT
echo "exclude_unstable=${{ inputs.exclude_unstable_input }}" >> $GITHUB_OUTPUT
echo "exclude_release_only=${{ inputs.exclude_release_only_input }}" >> $GITHUB_OUTPUT
else
exclude_slow=${{ inputs.is_feature_branch_draft_pr }}
exclude_unstable=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' }}
exclude_release_only=${{ inputs.is_feature_branch_draft_pr == 'true' || inputs.is_feature_branch_pr == 'true' || inputs.is_main_branch_push == 'true' }}
echo "exclude_slow=$exclude_slow" >> $GITHUB_OUTPUT
echo "exclude_unstable=$exclude_unstable" >> $GITHUB_OUTPUT
echo "exclude_release_only=$exclude_release_only" >> $GITHUB_OUTPUT
fi
32 changes: 29 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ on:
required: true
type: boolean
default: false
exclude-slow-tests:
description: 'Exclude slow tests'
required: true
type: boolean
default: true
exclude-unstable-tests:
description: 'Exclude unstable tests'
required: true
type: boolean
default: true
exclude-release-only-tests:
description: 'Exclude release only tests'
required: true
type: boolean
default: true

jobs:
get-exclude-dirs:
Expand All @@ -35,12 +50,23 @@ jobs:
- id: set-conditions
uses: ./.github/actions/set_run_conditions

- id: determine-exclusions
uses: ./.github/actions/determine_exclusions
with:
is_workflow_dispatch: ${{ github.event_name == 'workflow_dispatch' }}
exclude_slow_input: ${{ inputs.exclude-slow-tests }}
exclude_unstable_input: ${{ inputs.exclude-unstable-tests }}
exclude_release_only_input: ${{ inputs.exclude-release-only-tests }}
is_feature_branch_draft_pr: ${{ steps.set-conditions.outputs.is_feature_branch_draft_pr }}
is_feature_branch_pr: ${{ steps.set-conditions.outputs.is_feature_branch_pr }}
is_main_branch_push: ${{ steps.set-conditions.outputs.is_main_branch_push }}

- id: get-exclude-dirs
uses: ./.github/actions/get_exclude_dirs
with:
exclude-slow: ${{ steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' }}
exclude-unstable: ${{ steps.set-conditions.outputs.is_feature_branch_pr == 'true' || steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' }}
exclude-release-only: ${{ steps.set-conditions.outputs.is_feature_branch_pr == 'true' || steps.set-conditions.outputs.is_feature_branch_draft_pr == 'true' }}
exclude-slow: ${{ steps.determine-exclusions.outputs.exclude_slow }}
exclude-unstable: ${{ steps.determine-exclusions.outputs.exclude_unstable }}
exclude-release-only: ${{ steps.determine-exclusions.outputs.exclude_release_only }}

run-tests:
name: ${{ matrix.test_group.name }}
Expand Down
Loading

0 comments on commit f9c62ab

Please sign in to comment.