-
Notifications
You must be signed in to change notification settings - Fork 94
42 lines (39 loc) · 1.51 KB
/
test.yml
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
name: Test_Change
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- id: file_changes
uses: trilom/[email protected]
with:
output: "json"
fileOutput: "json"
- name: Check out repository code
uses: actions/checkout@v2
- name: Run changed files through test script
run: |
npm i
npm install -g ts-node
MODIFIED=${{ steps.file_changes.outputs.files_modified}} \
ADDED=${{ steps.file_changes.outputs.files_added}} \
ts-node ${{ github.workspace }}/.github/workflows/getTest.ts
RUN_FILES=$(
MODIFIED=${{ steps.file_changes.outputs.files_modified}} \
ADDED=${{ steps.file_changes.outputs.files_added}} \
ts-node ${{ github.workspace }}/.github/workflows/getFileList.ts
)
if [ "$RUN_FILES" = "[]" ]; then
echo "No adapter files were modified"
exit 0
fi
for i in $(echo $RUN_FILES | tr -d '[]' | tr "," "\n")
do
{
ts-node ${{ github.workspace }}/utils/test.ts ${{ github.workspace }}/${i} true
ts-node ${{ github.workspace }}/.github/workflows/comment.ts /home/runner/work/emissions-adapters/emissions-adapters/result.txt "${{ github.repository_owner }}" "${{ github.event.repository.name }}" "${{ github.event.number }}" ${i}
} || {
echo -n $i
echo ' doesnt run'
}
done