-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (64 loc) · 1.86 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
name: Tests
on:
pull_request:
branches: ["main"]
permissions:
contents: read
# Required for actions/jekyll-build-pages:
id-token: write
pages: write
jobs:
test-generation:
name: Generate Redirects
uses: ./.github/workflows/test-reusable.yml
with:
pre-run: |
# Create a test urls config file
cat <<- EOF > urls_tests.yml
---
test-a: http://www.a.com
test-b: http://www.b.com
test-c: http://www.c.com
EOF
urls_config: urls_tests.yml
default_redirect: "Nothing to see!"
post-run: bats ./tests/test_gen.bats
test-generation-paths:
name: Generate Redirects (sub-paths)
uses: ./.github/workflows/test-reusable.yml
with:
pre-run: |
# Create a test urls config file
cat <<- EOF > urls_tests.yml
---
a/b/c/test-d: http://www.abcd.com
EOF
urls_config: urls_tests.yml
default_redirect: "Nothing to see!"
post-run: bats ./tests/test_gen_paths.bats
test-default-redirect-url:
name: Default (Redirect URL)
uses: ./.github/workflows/test-reusable.yml
with:
urls_config: not_needed.yml
default_redirect: "http://www.d.com"
post-run: bats ./tests/test_default_url.bats
test-default-redirect-url-root:
name: Default (Redirect URL, root)
uses: ./.github/workflows/test-reusable.yml
with:
urls_config: not_needed.yml
default_redirect: /some_root_path
post-run: echo
test-default-message:
name: Default (Message)
uses: ./.github/workflows/test-reusable.yml
with:
urls_config: not_needed.yml
default_redirect: "abc"
post-run: bats ./tests/test_default_msg.bats
# Notes:
# Reusable workflows in the same repo MUST:
# * Be in ./.github/workflows
# * Be referenced (in "uses:") starting with "./",
# i.e. "./.github/workflows/<workflow>"