forked from maropu/predictive-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 2.02 KB
/
eval-spark-model.yml
File metadata and controls
62 lines (61 loc) · 2.02 KB
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
name: Evaluate Spark predictive testing model
on:
pull_request:
branches:
- master
paths:
- bin/train-ptesting-model.py
- models/spark/logs/**
- models/spark/indexes/latest
issue_comment:
types: [created, edited]
jobs:
eval-spark-model:
if: ${{ github.event_name == 'pull_request' ||
(contains(github.event.comment.html_url, '/pull/') && startsWith(github.event.comment.body, '/eval')) }}
runs-on: ubuntu-latest
env:
python: 3.7
strategy:
fail-fast: true
steps:
- name: Checkout predictive-testing repository
uses: actions/checkout@v2
# In order to fetch changed files
with:
fetch-depth: 0
- name: Checkout Spark repository
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: apache/spark
ref: master
path: spark-master
- name: Install Python packages (Python ${{ env.python }})
run: python -m pip install -r ./bin/requirements.txt
- name: Install JavaScript packages
run: npm install fs
- name: Build predictive model and compute eval metrics
run: SPARK_REPO=`pwd`/spark-master ./bin/train-spark-model.sh
- name: Post the result metrics
uses: actions/github-script@v5
with:
script: |
const fs = require('fs')
const metrics = fs.readFileSync('models/spark/model-eval-metric-summary.md').toString('utf8')
const commentBody = `Result Metrics:\n${metrics}`
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
})
- name: Upload updated model as artifact
if: success()
uses: actions/upload-artifact@v2
with:
name: spark-model-metrics
path: |
models/spark/model.pkl
models/spark/model-eval-*
models/spark/failed-tests.json