-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 2.29 KB
/
ci.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
---
name: Continuous Integration
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
build-tests:
name: Build ${{ matrix.input-type }} to ${{ matrix.output-type }}
runs-on: ubuntu-latest
strategy:
matrix:
input-type: [json, yaml]
output-type: [html, pdf]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.input-type }} to ${{ matrix.output-type }}
uses: ./
with:
action: render
file: resume.${{ matrix.input-type }}
folder: .github/test/render/${{ matrix.input-type }}-to-${{ matrix.output-type }}
theme-name: jsonresume-theme-eloquent
theme-local: false
output-type: ${{ matrix.output-type }}
- name: Check resume.${{ matrix.output-type }} exists
env:
INPUT_TYPE: ${{ matrix.input-type }}
OUTPUT_TYPE: ${{ matrix.output-type }}
run: |
if [ ! -f .github/test/render/"$INPUT_TYPE"-to-"$OUTPUT_TYPE"/resume."$INPUT_TYPE" ]; then
echo "File not found!"
exit 1
else
echo "File found!"
fi
validate-tests:
name: Validate ${{ matrix.input-type }} ${{ matrix.valid-type }}
runs-on: ubuntu-latest
strategy:
matrix:
input-type: [json, yaml]
valid-type: [valid, invalid]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate ${{ matrix.input-type }} ${{ matrix.valid-type }}
id: validate
continue-on-error: true
uses: ./
with:
action: validate
file: resume.${{ matrix.input-type }}
folder: .github/test/validate/${{ matrix.valid-type }}-${{ matrix.input-type }}
- name: Validate ${{ matrix.input-type }} ${{ matrix.valid-type }} result
env:
OUTCOME: ${{ steps.validate.outcome }}
VALID_TYPE: ${{ matrix.valid-type }}
run: |
if [ "$OUTCOME" == "success" ] && [ "$VALID_TYPE" == "invalid" ]; then
echo "Validation failed!"
exit 1
elif [ "$OUTCOME" == "failure" ] && [ "$VALID_TYPE" == "valid" ]; then
echo "Validation failed!"
exit 1
else
echo "Validation passed!"
fi