Skip to content

ESMF Test Results Summarizer #25902

ESMF Test Results Summarizer

ESMF Test Results Summarizer #25902

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