Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/test-sdc-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Test SDC Tasks

on:
# push:
# paths:
# - 'individual-shell-tools/**.sh'
# - 'shell-pipelines/**.sh'
# - 'jq/*.sh'
# pull_request:
# # paths: # i think its not working because paths are never updated if the type is updated
# # - 'individual-shell-tools/**.sh'
# # - 'shell-pipelines/**.sh'
# # - 'jq/*.sh'
# types:
# - labeled
# - unlabeled
# - opened
# - edited
# - reopened
pull_request_target:
# paths:
# - 'individual-shell-tools/**.sh'
# - 'shell-pipelines/**.sh'
# - 'jq/*.sh'
types:
- labeled
- unlabeled
- opened
- edited
- reopened

jobs:
test_sdc_tasks:

name: Test SDC Tasks
runs-on: ubuntu-slim
permissions:
pull-requests: write

steps:
- name: checkout pushed PR
uses: actions/checkout@v5
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47.0.5
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
- name: test individual shell tools
if: contains(steps.changed-files.outputs.all_changed_files, 'individual-shell-tools/awk/script-01.sh')
run: ./test-sdc.sh individual-shell-tools
shell: bash
- name: test jq
if: contains(steps.changed-files.outputs.all_changed_files, 'jq/script-01.sh')
run: ./test-sdc.sh jq
shell: bash
- name: test shell-pipelines
if: contains(steps.changed-files.outputs.all_changed_files, 'shell-pipelines/ls-grep/script-01.sh')
run: ./test-sdc.sh shell-pipelines
shell: bash
- name: read test output
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')
id: read-test-output
run: |
echo 'testoutput<<EOF' >> $GITHUB_OUTPUT
cat testoutput.txt >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
# - uses: actions/github-script@v7
# id: get_pr_data
# with: # this isn't going to work with a fork pr
# script: |
# return (
# await github.rest.repos.listPullRequestsAssociatedWithCommit({
# commit_sha: context.sha,
# owner: context.repo.owner,
# repo: context.repo.repo,
# })
# ).data[0];
- name: make output comment
uses: peter-evans/create-or-update-comment@v5.0.0
with:
issue-number: ${{ github.event.number }} # ${{ fromJson(steps.get_pr_data.outputs.result).number }}
body: ${{ steps.read-test-output.outputs.testoutput }}
- uses: actions/github-script@v7
id: update-labels
if: contains(steps.read-test-output.outputs.testoutput, 'complete!')
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.number }},
labels: ["Complete"]
});
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.number }},
name: "Needs Review"
});
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
testoutput.txt
6 changes: 6 additions & 0 deletions expect/individual-shell-tools/awk/script-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed
Basia
Mehmet
Leila
Piotr
Chandra
12 changes: 12 additions & 0 deletions expect/individual-shell-tools/awk/script-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Ahmed London
Basia London
Mehmet Birmingham
Leila London
Piotr Glasgow
Chandra Birmingham
Ahmed London
Basia London
Mehmet Birmingham
Leila London
Piotr Glasgow
Chandra Birmingham
6 changes: 6 additions & 0 deletions expect/individual-shell-tools/awk/script-03.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed 1
Basia 22
Mehmet 3
Leila 1
Piotr 15
Chandra 12
3 changes: 3 additions & 0 deletions expect/individual-shell-tools/awk/script-04.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Ahmed 4
Basia 6
Leila 1
6 changes: 6 additions & 0 deletions expect/individual-shell-tools/awk/script-05.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed 3
Basia 3
Mehmet 3
Leila 1
Piotr 5
Chandra 2
1 change: 1 addition & 0 deletions expect/individual-shell-tools/awk/script-06-stretch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
54
Empty file.
6 changes: 6 additions & 0 deletions expect/individual-shell-tools/awk/script-07-stretch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed 15
Basia 37
Mehmet 32
Leila 1
Piotr 61
Chandra 18
1 change: 1 addition & 0 deletions expect/individual-shell-tools/cat/script-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Once upon a time...
5 changes: 5 additions & 0 deletions expect/individual-shell-tools/cat/script-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Once upon a time...
There was a house made of gingerbread.
It looked delicious.
I was tempted to take a bite of it.
But this seemed like a bad idea...
3 changes: 3 additions & 0 deletions expect/individual-shell-tools/cat/script-03.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 It looked delicious.
2 I was tempted to take a bite of it.
3 But this seemed like a bad idea...
5 changes: 5 additions & 0 deletions expect/individual-shell-tools/cat/script-04-stretch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1 Once upon a time...
2 There was a house made of gingerbread.
3 It looked delicious.
4 I was tempted to take a bite of it.
5 But this seemed like a bad idea...
6 changes: 6 additions & 0 deletions expect/individual-shell-tools/grep/script-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Doctor: Hello
Doctor: What's wrong today?
Doctor: That sounds frustrating. When did this start?
Doctor: Say "Hi".
Doctor: You didn't say hello
Doctor: You're welcome, goodbye
9 changes: 9 additions & 0 deletions expect/individual-shell-tools/grep/script-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Doctor: Hello
Patient: Hello Doctor
Doctor: What's wrong today?
Doctor: That sounds frustrating. When did this start?
Doctor: Say "Hi".
Doctor: You didn't say hello
Doctor: You're welcome, goodbye
Patient: I went to the doctor!
Spouse: I'm glad you saw the Doctor: did they cure you?
1 change: 1 addition & 0 deletions expect/individual-shell-tools/grep/script-03.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
10 changes: 10 additions & 0 deletions expect/individual-shell-tools/grep/script-04.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Doctor: What's wrong today?
Doctor: That sounds frustrating. When did this start?
Doctor: Say "Hi".
Patient: Hi
Patient: I seem to be cured!
Doctor: You're welcome, goodbye

Patient: I went to the doctor!
Spouse: I'm glad you saw the Doctor: did they cure you?
Patient: Yes!
5 changes: 5 additions & 0 deletions expect/individual-shell-tools/grep/script-05.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Doctor: You didn't say hello
Patient: I seem to be cured!
--
Patient: I went to the doctor!
Spouse: I'm glad you saw the Doctor: did they cure you?
2 changes: 2 additions & 0 deletions expect/individual-shell-tools/grep/script-06.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dialogue-2.txt
dialogue.txt
3 changes: 3 additions & 0 deletions expect/individual-shell-tools/grep/script-07.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dialogue-2.txt:2
dialogue-3.txt:0
dialogue.txt:6
5 changes: 5 additions & 0 deletions expect/individual-shell-tools/ls/script-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
child-directory
script-01.sh
script-02.sh
script-03.sh
script-04.sh
3 changes: 3 additions & 0 deletions expect/individual-shell-tools/ls/script-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
helper-1.txt
helper-2.txt
helper-3.txt
11 changes: 11 additions & 0 deletions expect/individual-shell-tools/ls/script-03.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.:
child-directory
script-01.sh
script-02.sh
script-03.sh
script-04.sh

./child-directory:
helper-1.txt
helper-2.txt
helper-3.txt
8 changes: 8 additions & 0 deletions expect/individual-shell-tools/ls/script-04.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
First exercise (sorted newest to oldest):
helper-3.txt
helper-1.txt
helper-2.txt
Second exercise (sorted oldest to newest):
helper-2.txt
helper-1.txt
helper-3.txt
11 changes: 11 additions & 0 deletions expect/individual-shell-tools/sed/script-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ThIs Is a sample fIle for experImentIng wIth sed.

It contaIns many lInes, and there are some thIngs you may want to do wIth each of them.

We'll Include some score InformatIon:
37 AlIsha
15 Jacob
7 PIetro
3 Katya

We also should remember, when we go shoppIng, to get 4 Items: oranges,cheese,bread,olIves.
11 changes: 11 additions & 0 deletions expect/individual-shell-tools/sed/script-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is a sample file for experimenting with sed.

It contains many lines, and there are some things you may want to do with each of them.

We'll include some score information:
Alisha
Jacob
Pietro
Katya

We also should remember, when we go shopping, to get items: oranges,cheese,bread,olives.
6 changes: 6 additions & 0 deletions expect/individual-shell-tools/sed/script-03.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This is a sample file for experimenting with sed.

It contains many lines, and there are some things you may want to do with each of them.

We'll include some score information:

11 changes: 11 additions & 0 deletions expect/individual-shell-tools/sed/script-04.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is a sample file for experimenting with sed.

It contains many lines, and there are some things you may want to do with each of them.

We'll include some score information:
37 Alisha
15 Jacob
7 Pietro
3 Katya

We also should remember, when we go shopping, to get 4 items: oranges,cheese,bread,olives.
11 changes: 11 additions & 0 deletions expect/individual-shell-tools/sed/script-05.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is a sample file for experimenting with sed.

It contains many lines, and there are some things you may want to do with each of them.

We'll include some score information:
Alisha 37
Jacob 15
Pietro 7
Katya 3

We also should remember, when we go shopping, to get 4 items: oranges,cheese,bread,olives.
11 changes: 11 additions & 0 deletions expect/individual-shell-tools/sed/script-06.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is a sample file for experimenting with sed.

It contains many lines, and there are some things you may want to do with each of them.

We'll include some score information:
37 Alisha
15 Jacob
7 Pietro
3 Katya

We also should remember, when we go shopping, to get 4 items: oranges, cheese, bread, olives.
1 change: 1 addition & 0 deletions expect/individual-shell-tools/wc/script-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19 ../helper-files/helper-3.txt
1 change: 1 addition & 0 deletions expect/individual-shell-tools/wc/script-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3 ../helper-files/helper-3.txt
4 changes: 4 additions & 0 deletions expect/individual-shell-tools/wc/script-03.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 4 20 ../helper-files/helper-1.txt
1 7 39 ../helper-files/helper-2.txt
3 19 92 ../helper-files/helper-3.txt
5 30 151 total
1 change: 1 addition & 0 deletions expect/jq/script-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Selma
1 change: 1 addition & 0 deletions expect/jq/script-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
35 Fashion Street, London, E1 6PX
2 changes: 2 additions & 0 deletions expect/jq/script-03.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Selma, Software Engineer
Selma, Software Engineer
6 changes: 6 additions & 0 deletions expect/jq/script-04.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed
Basia
Mehmet
Leila
Piotr
Chandra
6 changes: 6 additions & 0 deletions expect/jq/script-05.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed London
Basia London
Mehmet Birmingham
Leila London
Piotr Glasgow
Chandra Birmingham
6 changes: 6 additions & 0 deletions expect/jq/script-06.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed 1
Basia 22
Mehmet 3
Leila 1
Piotr 15
Chandra 12
6 changes: 6 additions & 0 deletions expect/jq/script-07.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed 4
Basia 6
Mehmet 17
Leila 1
Piotr 8
Chandra 6
6 changes: 6 additions & 0 deletions expect/jq/script-08.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed 3
Basia 3
Mehmet 3
Leila 1
Piotr 5
Chandra 2
6 changes: 6 additions & 0 deletions expect/jq/script-09.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Ahmed 15
Basia 37
Mehmet 32
Leila 1
Piotr 61
Chandra 18
1 change: 1 addition & 0 deletions expect/jq/script-10.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
54
1 change: 1 addition & 0 deletions expect/jq/script-11.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
164
11 changes: 11 additions & 0 deletions expect/shell-pipelines/ls-grep/script-01.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Ariane
Daniel
HoChiMinh
KualaLumpur
Levi
London
NewYork
Niamh
Olga
York
dHondt
10 changes: 10 additions & 0 deletions expect/shell-pipelines/ls-grep/script-02.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Ariane
Daniel
HoChiMinh
KualaLumpur
Levi
London
NewYork
Niamh
Olga
York
Loading
Loading