Skip to content

Commit 6dec799

Browse files
author
l
committed
Add expected answers and test yaml
1 parent 4350f48 commit 6dec799

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+453
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test SDC Tasks
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- labeled
7+
- unlabeled
8+
- opened
9+
- edited
10+
- reopened
11+
12+
jobs:
13+
test_sdc_tasks:
14+
15+
name: Test SDC Tasks
16+
runs-on: ubuntu-slim
17+
permissions:
18+
pull-requests: write
19+
20+
steps:
21+
- name: checkout pushed PR
22+
uses: actions/checkout@v5
23+
- name: Get changed files
24+
id: changed-files
25+
uses: tj-actions/changed-files@v47.0.5
26+
- name: test individual shell tools
27+
if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh')
28+
run: ./test-sdc.sh individual-shell-tools
29+
shell: bash
30+
- name: test jq
31+
if: contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh')
32+
run: ./test-sdc.sh jq
33+
shell: bash
34+
- name: test shell-pipelines
35+
if: contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
36+
run: ./test-sdc.sh shell-pipelines
37+
shell: bash
38+
- name: make output comment
39+
if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
40+
env:
41+
GH_TOKEN: ${{ secrets.MY_TOKEN }}
42+
ISSUE_URL: ${{ github.event.issue.html_url }}
43+
run: |
44+
gh issue comment $ISSUE_URL --body-FILE testoutput.TXT
45+
- name: read test output
46+
if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh') || contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
47+
id: read-test-output
48+
run: |
49+
echo 'testoutput<<EOF' >> $GITHUB_OUTPUT
50+
cat testoutput.txt >> $GITHUB_OUTPUT
51+
echo EOF >> $GITHUB_OUTPUT
52+
- name: add appropriate labels
53+
if: contains(steps.read-test-output.outputs.testoutput, 'complete!')
54+
env:
55+
GH_TOKEN: ${{ secrets.MY_TOKEN }}
56+
ISSUE_URL: ${{ github.event.issue.html_url }}
57+
run: |
58+
gh issue edit $ISSUE_URL --add-label "Complete"
59+
gh issue edit $ISSUE_URL --remove-label "Needs Review"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
testoutput.txt
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Ahmed
2+
Basia
3+
Mehmet
4+
Leila
5+
Piotr
6+
Chandra
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Ahmed London
2+
Basia London
3+
Mehmet Birmingham
4+
Leila London
5+
Piotr Glasgow
6+
Chandra Birmingham
7+
Ahmed London
8+
Basia London
9+
Mehmet Birmingham
10+
Leila London
11+
Piotr Glasgow
12+
Chandra Birmingham
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Ahmed 1
2+
Basia 22
3+
Mehmet 3
4+
Leila 1
5+
Piotr 15
6+
Chandra 12
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Ahmed 4
2+
Basia 6
3+
Leila 1
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Ahmed 3
2+
Basia 3
3+
Mehmet 3
4+
Leila 1
5+
Piotr 5
6+
Chandra 2
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
54

expect/individual-shell-tools/awk/script-06.sh

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Ahmed 15
2+
Basia 37
3+
Mehmet 32
4+
Leila 1
5+
Piotr 61
6+
Chandra 18

0 commit comments

Comments
 (0)