-
-
Notifications
You must be signed in to change notification settings - Fork 88
69 lines (64 loc) · 2.01 KB
/
test-sdc-tasks.yml
File metadata and controls
69 lines (64 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Test SDC Tasks
on:
push:
paths:
- 'individual-shell-tools/**.sh'
- 'shell-pipelines/**.sh'
- 'jq/*.sh'
pull_request_target:
types:
- labeled
- unlabeled
- opened
- edited
- reopened
jobs:
test_sdc_tasks:
name: Test SDC Tasks
runs-on: ubuntu-slim
permissions:
pull-requests: read
steps:
- name: checkout pushed PR
uses: actions/checkout@v5
# with:
# fetch-depth: 2
# - name: checkout expected output
# uses: actions/checkout@v5
# with:
# ref: origin/expected-solutions
# path: expect
- 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
id: read-test-output
run: |
# Read output.txt and write to GITHUB_OUTPUT
echo 'testoutput<<EOF' >> $GITHUB_OUTPUT
cat testoutput.txt >> $GITHUB_OUTPUT
echo EOF
- name: make output comment
uses: peter-evans/create-or-update-comment@v5.0.0
with:
issue-number: ${{ github.event.number }}
body: ${{ steps.read-test-output.outputs.testoutput }}