-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (101 loc) · 3.45 KB
/
generate-esmf-summaries.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: ESMF Test Results Summarizer
on:
schedule:
- cron: '*/60 * * * *'
workflow_dispatch:
inputs:
rebuild-database:
description: 'Rebuild database?'
required: true
type: boolean
default: false
debug-logging:
description: 'Output debug logging?'
required: true
type: boolean
default: false
no-update:
description: 'Skip artifacts update?'
required: true
type: boolean
default: false
# Disallow concurrent runs of the summarizer
concurrency: esmf-summarizer
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check on free disk space
run: |
df -h
- name: Checkout summarizer scripts
uses: actions/checkout@v3
with:
repository: esmf-org/esmf-test-scripts
path: esmf-test-scripts
ref: main
- name: Restore summarizer database
uses: actions/cache@v2
with:
path: summarizer-db
key: summarizer-db-${{github.run_id}}
restore-keys: summarizer-db-
- name: Checkout ESMF test artifacts
run: |
git clone --progress --filter=blob:none https://github.com/esmf-org/esmf-test-artifacts
- name: Checkout ESMF
uses: actions/checkout@v3
with:
repository: esmf-org/esmf
path: esmf
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml
pip install jinja2
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Checkout esmf-test-summary
uses: actions/checkout@v3
with:
repository: esmf-org/esmf-test-summary
path: esmf-test-summary
ref: main
- name: Should refresh?
if: ${{ inputs.rebuild-database }}
run: echo "REBUILD_DB=--refresh" >> $GITHUB_ENV
- name: Should debug?
if: ${{ inputs.debug-logging }}
run: echo "DEBUG_LOGGING=--debug" >> $GITHUB_ENV
- name: Should skip artifacts update?
if: ${{ inputs.no-update }}
run: echo "NO_UPDATE=--no-update" >> $GITHUB_ENV
- name: Generate summaries
run: |
echo $GITHUB_WORKSPACE
mkdir -p $GITHUB_WORKSPACE/htmlout
mkdir -p $GITHUB_WORKSPACE/summarizer-db
df -h
$GITHUB_WORKSPACE/esmf-test-scripts/python_scripts/summarize_artifacts.py -c $GITHUB_WORKSPACE/esmf-test-summary/summarizer.yaml -a $GITHUB_WORKSPACE/esmf-test-artifacts -e $GITHUB_WORKSPACE/esmf -d $GITHUB_WORKSPACE/summarizer-db --output-dir $GITHUB_WORKSPACE/htmlout ${{ env.REBUILD_DB }} ${{ env.DEBUG_LOGGING }} ${{ env.NO_UPDATE }}
df -h
- name: Copy HTML
run: |
cd $GITHUB_WORKSPACE/esmf-test-summary
git fetch
git reset --hard origin/main
rm -rf $GITHUB_WORKSPACE/esmf-test-summary/docs/*
cp -R $GITHUB_WORKSPACE/htmlout/* $GITHUB_WORKSPACE/esmf-test-summary/docs
- name: Commit and push HTML
uses: actions-js/push@master
with:
directory: ${{ github.workspace }}/esmf-test-summary
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: summarizer-db
path: ${{ github.workspace }}/summarizer-db