-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (76 loc) · 2.36 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
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
branches:
- '*'
tags-ignore:
- '*'
release:
types:
- created
jobs:
test_no_changes:
runs-on: ubuntu-latest
name: Test (no formatting changes)
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run action
id: test-action
uses: findologic/intellij-format-action@main
with:
include-glob: '*.kt'
path: test/no_formatting_necessary
fail-on-changes: false
- name: Assert no files changed
run: '[[ ${{ steps.test-action.outputs.files-changed }} == 0 ]]'
test_with_changes:
runs-on: ubuntu-latest
name: Test (with formatting changes)
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run action
id: test-action
uses: findologic/intellij-format-action@main
with:
include-glob: '*.kt'
path: test/formatting_necessary
fail-on-changes: false
- name: Assert file change detected
run: '[[ ${{ steps.test-action.outputs.files-changed }} -gt 0 ]]'
test_without_changes_different_pattern:
runs-on: ubuntu-latest
name: Test (no changes due to pattern mismatch)
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run action
id: test-action
uses: findologic/intellij-format-action@main
with:
include-glob: '*.java'
path: test/formatting_necessary
fail-on-changes: false
- name: Assert no files changed
run: '[[ ${{ steps.test-action.outputs.files-changed }} == 0 ]]'
test_fail_on_changes:
runs-on: ubuntu-latest
name: Test (fail on changes enabled)
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run action
id: test-action
uses: findologic/intellij-format-action@main
with:
include-glob: '*.kt'
path: test/formatting_necessary
fail-on-changes: true
continue-on-error: true
- name: Assert file change detected
run: '[[ ${{ steps.test-action.outputs.files-changed }} -gt 0 ]]'
- name: Assert action failed
run: '[[ ${{ steps.test-action.outcome }} == "failure" ]]'
- name: Assert conclusion is success, because continue-on-error
run: '[[ ${{ steps.test-action.conclusion }} == "success" ]]'