Skip to content

Commit 96a931b

Browse files
author
l
committed
merge action yaml, add trigger filter
1 parent c6dc9c4 commit 96a931b

2 files changed

Lines changed: 53 additions & 65 deletions

File tree

.github/workflows/test-sdc-tasks.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/validate-pr-metadata.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,56 @@ jobs:
1616
- uses: CodeYourFuture/actions/validate-pr-metadata@main
1717
with:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
test_sdc_tasks:
21+
name: Test SDC Tasks
22+
runs-on: ubuntu-slim
23+
permissions:
24+
pull-requests: write
25+
needs: [validate_pr_metadata]
26+
if: ${{ github.event.label.name == 'Needs Review' }}
27+
steps:
28+
- name: checkout base branch
29+
uses: actions/checkout@v5
30+
- name: Get changed files
31+
id: changed-files
32+
uses: tj-actions/changed-files@v47.0.5
33+
- name: test individual shell tools
34+
id: test-individual-shell-tools
35+
if: contains(steps.changed-files.outputs.modified_files, 'individual-shell-tools/')
36+
run: ./test-sdc.sh individual-shell-tools
37+
shell: bash
38+
- name: test jq
39+
id: test-jq
40+
if: contains(steps.changed-files.outputs.modified_files, 'jq/')
41+
run: ./test-sdc.sh jq
42+
shell: bash
43+
- name: test shell-pipelines
44+
id: test-shell-pipelines
45+
if: contains(steps.changed-files.outputs.modified_files, 'shell-pipelines/')
46+
run: ./test-sdc.sh shell-pipelines
47+
shell: bash
48+
- name: test number-systems
49+
id: test-number-systems
50+
if: contains(steps.changed-files.outputs.modified_files, 'number-systems/')
51+
run: ./test-sdc.sh number-systems
52+
shell: bash
53+
- name: make output comment
54+
if: steps.test-individual-shell-tools.outputs.attempted == 'y' || steps.test-jq.outputs.attempted == 'y' || steps.test-shell-pipelines.outputs.attempted == 'y' || steps.test-number-systems.outputs.attempted == 'y'
55+
env:
56+
GH_TOKEN: ${{ github.token }}
57+
ISSUE_URL: ${{ github.event.pull_request.html_url }}
58+
run: |
59+
gh pr comment $ISSUE_URL --body-file testoutput.txt
60+
- name: add appropriate labels
61+
if: steps.test-individual-shell-tools.outputs.complete == 'y' || steps.test-jq.outputs.complete == 'y' || steps.test-shell-pipelines.outputs.complete == 'y'
62+
env:
63+
GH_TOKEN: ${{ github.token }}
64+
ISSUE_URL: ${{ github.event.pull_request.html_url }}
65+
run: |
66+
gh pr edit $ISSUE_URL --add-label "Complete"
67+
gh pr edit $ISSUE_URL --remove-label "Needs Review"
68+
- name: fail if not complete
69+
if: (steps.test-individual-shell-tools.outputs.attempted == 'y' || steps.test-jq.outputs.attempted == 'y' || steps.test-shell-pipelines.outputs.attempted == 'y') && !(steps.test-individual-shell-tools.outputs.complete == 'y' || steps.test-jq.outputs.complete == 'y' || steps.test-shell-pipelines.outputs.complete == 'y')
70+
run: |
71+
exit -1

0 commit comments

Comments
 (0)