Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 35d0f96

Browse files
authored
GH Action & error-handling.gv (#48)
1 parent 91ea9fa commit 35d0f96

File tree

2 files changed

+47
-6
lines changed

2 files changed

+47
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# name: check-graphviz-file
2+
# ts-graphviz/setup-graphviz@v1 : https://github.com/ts-graphviz/setup-graphviz
3+
# tj-actions/changed-files@v9 : https://github.com/tj-actions/changed-files
4+
# Trigger the workflow on [pull_request, push]
5+
# but only for the main/master branch
6+
on:
7+
pull_request:
8+
branches: [ master ]
9+
push:
10+
branches: [ master]
11+
12+
jobs:
13+
check-graphviz-file:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: ts-graphviz/setup-graphviz@v1
22+
23+
- name: Get specific changed file(s)
24+
id: changed-files-specific
25+
uses: tj-actions/changed-files@v9
26+
with :
27+
files: |
28+
error-handling.gv
29+
30+
- name: Create svg if the listed file changed
31+
if: steps.changed-files-specific.outputs.only_changed == 'true'
32+
run: |
33+
dot -Tsvg error-handling.gv > error-handling.svg
34+
35+
- name: 'Upload Artifact if the listed file changed'
36+
if: steps.changed-files-specific.outputs.only_changed == 'true'
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: error-handling
40+
path: error-handling.svg
41+
retention-days: 30

error-handling.gv

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
digraph g {
22
graph [
33
rankdir = "LR";
4-
label= <<u>Error Handling</u>>;
4+
// title
5+
labelloc= "t";
6+
label= <<b><u>Error Handling</u></b>>;
57
];
68

79
node [
@@ -13,7 +15,6 @@ digraph g {
1315
label = "&lt; T &gt;"
1416
shape = plain
1517
fontsize=9
16-
PORT = "f0"
1718
id = 0
1819
];
1920

@@ -49,17 +50,16 @@ digraph g {
4950
id = 4
5051
];
5152

52-
// Layout
53-
53+
// Layout
5454
// T to Option {reverse direction i.e. <-}
55-
{T:f0 -> Option:f0 [
55+
{T -> Option:f0 [
5656
dir=back
5757
label="Some(T)\nunwrap()"
5858
fontsize=8
5959
];
6060
}
6161

62-
Result:f0 -> T:f0 [
62+
Result:f0 -> T [
6363
label="Ok(T)\nunwrap()"
6464
fontsize=8
6565
];

0 commit comments

Comments
 (0)