Update workflow config #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |