forked from precice/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (71 loc) · 2.37 KB
/
generate_reference_results_workflow.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
name: Generate reference results workflow
on:
workflow_call:
inputs:
from_ref:
description: 'Use the systemtests + tutorial metadata + reference_version from this ref'
required: true
type: string
commit_msg:
description: 'Commit msg for commit that adds the reference results'
default: "Adding reference results"
type: string
loglevel:
description: 'loglevel used for the systemtests'
default: 'INFO'
required: true
type: string
jobs:
generate_reference_results:
runs-on: [self-hosted, linux, x64, precice-tests-vm]
steps:
- name: Display a quick job summary
run: |
echo "Initiated by: ${{ github.actor }}"
echo "Running generate_reference_results.py --log-level ${{inputs.loglevel}}"
echo "Using Ref: ${{ inputs.from_ref }}"
echo "Commit message on success: ${{ inputs.commit_msg }}"
- name: Move LFS URL to local LFS server
run: |
/home/precice/runners_root/scripts/make_lfs_local.sh
- name: 'Cleanup the folder'
# The first rf -rf ./* removes all non hidden files
# The second rf -rf ./.??* removes all hidden files (but not . and ..)
run: |
ls -la ./
rm -rf ./*
rm -rf ./.??*
ls -la ./
- name: Check out Tutorials for systest
uses: actions/checkout@v4
with:
ref: ${{ inputs.from_ref }}
lfs: true
fetch-depth: 0
- name: Install Python dependencies
run: |
pip install --user -r tools/tests/requirements.txt
- name: Run tests
run: |
cd tools/tests
test -f generate_reference_results.py && export GENERATE_REF_RESULTS=generate_reference_results.py
test -f generate_reference_data.py && export GENERATE_REF_RESULTS=generate_reference_data.py
echo "Selected $GENERATE_REF_RESULTS to run"
python $GENERATE_REF_RESULTS --log-level=${{inputs.loglevel}}
cd ../../
- name: Create commit
if: success()
run: |
git checkout ${{ inputs.from_ref }}
git add ./*/*/*.tar.gz
git add ./*/*.tar.gz
git add ./*/*.metadata
git commit -m "${{inputs.commit_msg}}"
git push
- name: Upload artifacts for debugging
if: failure()
uses: actions/upload-artifact@v3
with:
name: runs
path: |
runs/*