-
Notifications
You must be signed in to change notification settings - Fork 18
73 lines (58 loc) · 1.71 KB
/
test.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
name: test
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
jobs:
directory:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test on affected directory
uses: ./
with:
directory: "tests/directory/affected"
- name: Assert not affected result does not exist
run: |
! test -e tests/directory/not-affected/main.min.js
- name: Assert affected result matches expected
run: |
git diff --exit-code --no-index \
tests/directory/affected/main.expected.js \
tests/directory/affected/main.min.js
maxdepth:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test on shallow maxdepth
uses: ./
with:
directory: "tests/maxdepth"
maxdepth: 1
- name: Assert shallow result matches expected
run: |
git diff --exit-code --no-index \
tests/maxdepth/main.expected.js \
tests/maxdepth/main.min.js
- name: Assert deep result does not exist
run: |
! test -e tests/maxdepth/not-affected/main.min.js
overwrite:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test overwrite
uses: ./
with:
directory: "tests/overwrite"
overwrite: true
- name: Assert overwrite result matches expected
run: |
git diff --exit-code --no-index \
tests/overwrite/main.expected.js \
tests/overwrite/main.js