Skip to content

Commit

Permalink
Simplify the workflow on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iainelder committed Jul 1, 2024
1 parent d294bdc commit 715d622
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
list_installers:
name: List installers
name: List all installers
runs-on: ubuntu-latest
outputs:
installers: ${{steps.list_step.outputs.installers}}
Expand Down
31 changes: 5 additions & 26 deletions .github/workflows/test_changes.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
name: Test changes
name: Test changed installers
on:
push:
workflow_dispatch:

jobs:
list_installers:
name: List installers under test
name: List changed installers
runs-on: ubuntu-latest
outputs:
installers: ${{ github.event_name == 'push' && steps.changed.outputs.changed_installers || steps.all.outputs.all_installers }}
installers: ${{steps.dirs.outputs.changed_installers}}
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Get changed installer files
if: github.event_name == 'push'
id: changed-installers
id: files
uses: tj-actions/changed-files@v44
with:
files: programs/**

- name: Get changed installer names
id: changed
if: github.event_name == 'push'
id: dirs
env:
CHANGED_FILES: ${{steps.changed-installers.outputs.all_changed_files}}
run: |
Expand All @@ -32,24 +29,6 @@ jobs:
| cut -d/ -f2 | sort -u | jq -R | jq -s -c -M
} >> "$GITHUB_OUTPUT"
- name: Get all installer names
id: all
if: github.event_name != 'push'
run: |
{
printf "all_installers="
find programs -mindepth 1 -maxdepth 1 -printf "%P\n" \
| sort | jq -R | jq -s -c -M
} >> "$GITHUB_OUTPUT"
- name: Debug event
env:
EVENT_NAME: ${{github.event_name}}
EVENT: ${{toJson(github.event)}}
run: |
echo "$EVENT_NAME"
echo "$EVENT"
test_installers:
name: Test installers
needs: list_installers
Expand Down

0 comments on commit 715d622

Please sign in to comment.