-
-
Notifications
You must be signed in to change notification settings - Fork 12
140 lines (130 loc) · 4.26 KB
/
drawio-export-action.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: drawio-export-action
on:
pull_request:
push:
branches:
- v2.x
jobs:
os-testing-with-shallow-clone:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# Dockerfile actions are only supported on Linux
# - macos-latest
# - windows-latest
concurrency:
group: drawio-export-action-os-testing-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Verify // it's a force-push commit on a push event?
run: echo "::notice ::This is a force-push commit, some tests are desactivated because of it."
shell: bash
if: ${{ github.event_name == 'push' && github.event.forced }}
# Test 1
- id: must-fail-on-shallow-clone
name: Testing fail on shallow clone
uses: ./
with:
action-mode: recent
continue-on-error: true
# Useless on force-push commit on push event
if: ${{ !(github.event_name == 'push' && github.event.forced) }}
- name: Validate // Testing fail on shallow clone
run: |
[[ "${{ steps.must-fail-on-shallow-clone.outputs.error_message }}" == "This is a shallow git repository." ]]
[[ "${{ steps.must-fail-on-shallow-clone.outcome }}" == "failure" ]]
[[ "${{ steps.must-fail-on-shallow-clone.conclusion }}" == "success" ]]
shell: bash
# Useless on force-push commit on push event
if: ${{ !(github.event_name == 'push' && github.event.forced) }}
# Test 2
- name: Testing with options
uses: ./
with:
path: tests/data
format: adoc
output: 'test2-output'
remove-page-suffix: true
border: 1
scale: 1
width: 100
height: 100
crop: true
enable-plugins: true
embed-svg-images: true
embed-diagram: true
transparent: true
quality: 95
uncompressed: true
action-mode: all
- name: Validate // Testing with options
run: |
[[ -s "tests/data/test2-output/nominal-Page-1.adoc" ]]
[[ -s "tests/data/test2-output/nominal-Page-1.png" ]]
[[ -s "tests/data/test2-output/nominal-Page-2.adoc" ]]
[[ -s "tests/data/test2-output/nominal-Page-2.png" ]]
shell: bash
os-testing-with-full-clone:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# Dockerfile actions are only supported on Linux
# - macos-latest
# - windows-latest
concurrency:
group: drawio-export-action-os-testing-with-full-clone-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Test 1
- name: Testing without any options
uses: ./
# Test 2
- name: Testing with recent setup
uses: ./
with:
action-mode: recent
# Test 3
- name: Testing with reference setup
uses: ./
with:
action-mode: reference
since-reference: HEAD~2
# Test 4
- name: Testing with only the since-reference option
uses: ./
with:
since-reference: HEAD~2
# Test 5
- id: must-fail-without-since-reference
name: Testing fail on missing since-reference option
uses: ./
with:
action-mode: reference
continue-on-error: true
- name: Validate // Testing fail on missing since-reference option
run: |
[[ "${{ steps.must-fail-without-since-reference.outputs.error_message }}" == "The 'since-reference' option is mandatory." ]]
[[ "${{ steps.must-fail-without-since-reference.outcome }}" == "failure" ]]
[[ "${{ steps.must-fail-without-since-reference.conclusion }}" == "success" ]]
shell: bash
release:
runs-on: ubuntu-latest
needs:
- os-testing-with-shallow-clone
- os-testing-with-full-clone
concurrency:
group: drawio-export-action-release-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- name: Release this GitHub Action
uses: rlespinasse/release-that@v1