-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (60 loc) · 1.7 KB
/
test_run_funcs.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
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
69
70
71
72
73
74
75
76
77
78
79
name: Test run funcs
on: [push]
permissions:
contents: write
jobs:
test_ruby_func:
runs-on: ubuntu-latest
name: A job to test run functions
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clear result files ahead for test
run: rm -rf test/result
- name: Run funcs
run: |
python3 -m pip install .
python3 -m gitfx test/func_examples test/func_examples/a_nested_code_folder
- name: Check if result files exist
run: |
cd test/result
files=(elixir_string
golang.json
golang_string
haskell.json
node.json
node_string
perl.json
php.json
python.json
python_second.json
python_string
ruby.json
ruby_second.json
test_before_script
bash_string
bash.json
rust_string
test_multi_code_folders
deno_string
)
status=0
for f in "${files[@]}"
do
if [ ! -f $f ]; then
echo "File not found: $f"
status=1
fi
done
exit $status
- name: Git commit
run: |
# git commit if there's any change
if test -n "$(git status --porcelain 2>/dev/null)"; then
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Add changes"
git pull
git push origin ${GITHUB_REF##*/}
fi