Skip to content

Commit 35ff91d

Browse files
author
l
committed
attempt actions test
1 parent 407b010 commit 35ff91d

File tree

114 files changed

+526
-1
lines changed

Some content is hidden

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

114 files changed

+526
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Test SDC Tasks
2+
3+
on: pull_request
4+
paths:
5+
- 'individual-shell-tools/**.sh'
6+
- 'shell-pipelines/**.sh'
7+
- 'jq/*.sh'
8+
pull_request_target:
9+
types:
10+
- labeled
11+
- unlabeled
12+
- opened
13+
- edited
14+
- reopened
15+
16+
jobs:
17+
test_sdc_tasks:
18+
19+
name: Test SDC Tasks
20+
runs-on: ubuntu-slim
21+
permissions:
22+
pull-requests: read
23+
24+
steps:
25+
- name: checkout pushed PR
26+
uses: actions/checkout@v5
27+
# with:
28+
# fetch-depth: 2
29+
- name: checkout expected output
30+
uses: actions/checkout@v5
31+
with:
32+
ref: origin/expected-solutions
33+
path: expect
34+
- name: Get changed files
35+
id: changed-files
36+
uses: tj-actions/changed-files@v47.0.5
37+
- name: List all changed files
38+
env:
39+
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
40+
run: |
41+
for file in ${ALL_CHANGED_FILES}; do
42+
echo "$file was changed"
43+
done
44+
- name: test individual shell tools
45+
if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh')
46+
run: ./test-sdc.sh individual-shell-tools
47+
shell: bash
48+
- name: test jq
49+
if: contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh')
50+
run: ./test-sdc.sh jq
51+
shell: bash
52+
- name: test shell-pipelines
53+
if: contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
54+
run: ./test-sdc.sh shell-pipelines
55+
shell: bash
56+
- name: read test output
57+
id: read-test-output
58+
run: |
59+
# Read output.txt and write to GITHUB_OUTPUT
60+
echo 'testoutput<<EOF' >> $GITHUB_OUTPUT
61+
cat testoutput.txt >> $GITHUB_OUTPUT
62+
echo EOF
63+
- name: make output comment
64+
uses: peter-evans/create-or-update-comment@v5.0.0
65+
with:
66+
issue-number: ${{ github.event.number }}
67+
body: ${{ steps.read-test-output.outputs.testoutput }}
68+

.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)