-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (91 loc) · 3.48 KB
/
test-local-action.yaml
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
on: [push]
jobs:
local_test_lasttag:
runs-on: ubuntu-latest
name: Test local action without fixed version
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
- name: Test local action
id: local-action
uses: ./
with:
upstream_repo: sysdiglabs/kube-psp-advisor
local_patch_dir: tests/sysdiglabs/kube-psp-advisor
outputs:
used_tag: ${{ steps.local-action.outputs.tag }}
used_latest: ${{ steps.local-action.outputs.latest }}
tag_major: ${{ steps.local-action.outputs.tag_major }}
tag_minor: ${{ steps.local-action.outputs.tag_minor }}
tag_patch: ${{ steps.local-action.outputs.tag_patch }}
local_test_fixed:
runs-on: ubuntu-latest
name: Test local action with fixed version
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
- name: Test local action
id: local-action
uses: ./
with:
upstream_repo: sysdiglabs/kube-psp-advisor
local_patch_dir: tests/sysdiglabs/kube-psp-advisor
upstream_ref: master
outputs:
used_tag: ${{ steps.local-action.outputs.tag }}
used_latest: ${{ steps.local-action.outputs.latest }}
tag_major: ${{ steps.local-action.outputs.tag_major }}
tag_minor: ${{ steps.local-action.outputs.tag_minor }}
tag_patch: ${{ steps.local-action.outputs.tag_patch }}
print_results:
runs-on: ubuntu-latest
name: Print test results
needs: [local_test_lasttag, local_test_fixed]
steps:
- run: |
echo "local_test_lasttag: ${{ needs.local_test_lasttag.outputs.used_tag }},${{ needs.local_test_lasttag.outputs.used_latest }}"
echo "local_test_fixed: ${{ needs.local_test_fixed.outputs.used_tag }},${{ needs.local_test_fixed.outputs.used_latest }}"
echo "semver_fixed: ${{ needs.local_test_fixed.outputs.tag_major }}, ${{ needs.local_test_fixed.outputs.tag_minor }}, ${{ needs.local_test_fixed.outputs.tag_patch }}"
echo "semver_lasttag: ${{ needs.local_test_lasttag.outputs.tag_major }}, ${{ needs.local_test_lasttag.outputs.tag_minor }}, ${{ needs.local_test_lasttag.outputs.tag_patch }}"
shell: bash
local_test_upstream_remove_files:
runs-on: ubuntu-latest
name: Test local action with upstream_remove_files set
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
- name: Test local action
id: local-action
uses: ./
with:
upstream_repo: sysdiglabs/kube-psp-advisor
local_patch_dir: tests/sysdiglabs/kube-psp-advisor
upstream_ref: master
upstream_remove_files: |
version
comparator/comparator.go
- name: Assert that files are removed
id: test-remove
run: |-
! [[ -f upstream/version ]] && ! [[ -f upstream/comparator/comparator.go ]]
shell: bash
local_test_copy_from_upstream:
runs-on: ubuntu-latest
name: Test local action with upstream_copy set
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
- name: Test local action
id: local-action
uses: ./
with:
upstream_repo: sysdiglabs/kube-psp-advisor
local_patch_dir: tests/sysdiglabs/kube-psp-advisor
upstream_ref: master
upstream_copy: |
generator/* tests/
- name: Assert that files are copied
id: test-copy
run: |-
[[ -f tests/generator.go ]] && [[ -f tests/generator_test.go ]]
shell: bash