-
Notifications
You must be signed in to change notification settings - Fork 18
102 lines (89 loc) · 3.2 KB
/
parse_and_plot.yml
File metadata and controls
102 lines (89 loc) · 3.2 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
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
# Syntax reference:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
name: Parse and plot
permissions: read-all
on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
pull_request:
types: [opened, synchronize]
env:
DEBIAN_FRONTEND: noninteractive
jobs:
parse-and-plot:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Update packages
run: sudo apt-get update
- name: Install tornettools dependencies
run: sudo apt-get install -y
python3
python3-dev
python3-pip
libxml2
libxml2-dev
libxslt1.1
libxslt1-dev
libpng16-16
libpng-dev
libfreetype6
libfreetype6-dev
libblas-dev
liblapack-dev
- name: Build tornettools
run: |
pip3 install wheel
pip3 install -r requirements.txt
pip3 install -I .
- name: Create output/working directory
run: mv .github/workflows/parse_and_plot_input parse_and_plot_output
- name: Re-parse
# -c must match the convergence time used to generate the golden data,
# in run_all_steps.yml
#
# We use --skip-raw to skip trying to parse the raw logs again, so that
# we don't need to check the raw logs into version control, and since
# the tgen and oniontrace parsing are done by those respective tools,
# which we're not trying to test here.
run: tornettools parse -c 300 --skip-raw parse_and_plot_output
# The json files in tornet.plot.data are the fully processed data used to
# generate graphs in the `plot` step. They should always be the same when
# parsing and plotting the same simulation data with a given version of
# tornettools.
#
# When this test fails due to an *intentional* change in processing, the
# golden data in `.github/workflows/parse_and_plot_output` can be updated
# using the actual output from this workflow's artifacts.
- name: Diff
run: |
for f in .github/workflows/parse_and_plot_output/tornet.plot.data/*.json
do
echo "Diffing $f"
diff $f parse_and_plot_output/tornet.plot.data/$(basename $f)
done
- name: Plot
# Run even if the diff step failed. In some cases the diff may be
# expected, in which case it'll still be helpful to compare the plots.
if: always()
# Plot reparsed against golden
run: tornettools plot --prefix pdfs -l golden reparsed -- .github/workflows/parse_and_plot_output parse_and_plot_output
- name: Upload pdfs
if: always()
uses: actions/upload-artifact@v4
with:
name: pdfs
path: pdfs
# This artifact can be used to update
# .github/workflows/parse_and_plot_output to a new expected output.
- name: Upload plot data
if: always()
uses: actions/upload-artifact@v4
with:
name: parse_and_plot_output
path: parse_and_plot_output/tornet.plot.data