-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (122 loc) · 4 KB
/
test.yml
File metadata and controls
153 lines (122 loc) · 4 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Test Action
on:
push:
branches: [main]
pull_request:
jobs:
test-latest:
name: Install latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-devhelm
id: setup
uses: ./
with:
devhelm-version: latest
- name: Verify devhelm is on PATH
run: which devhelm
- name: Verify version output
run: |
VERSION="${{ steps.setup.outputs.devhelm-version }}"
echo "Reported version: $VERSION"
[[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]] || { echo "::error::Invalid version format: $VERSION"; exit 1; }
- name: Verify CLI runs
run: devhelm --help
- name: Verify validate works without API
run: |
devhelm init --force
devhelm validate devhelm.yml
test-pinned:
name: Install pinned version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-devhelm
id: setup
uses: ./
with:
devhelm-version: '0.1.4'
- name: Verify exact version
run: |
EXPECTED="0.1.4"
ACTUAL="${{ steps.setup.outputs.devhelm-version }}"
echo "Expected: $EXPECTED, Got: $ACTUAL"
[[ "$ACTUAL" == "$EXPECTED" ]] || { echo "::error::Version mismatch: expected $EXPECTED, got $ACTUAL"; exit 1; }
test-env-export:
name: Environment variables
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-devhelm with env inputs
uses: ./
with:
api-token: test-token-value
api-url: https://api.staging.devhelm.io
org-id: '42'
workspace-id: '7'
- name: Verify DEVHELM_API_TOKEN
run: |
[[ "$DEVHELM_API_TOKEN" == "test-token-value" ]] || { echo "::error::DEVHELM_API_TOKEN not set"; exit 1; }
- name: Verify DEVHELM_API_URL
run: |
[[ "$DEVHELM_API_URL" == "https://api.staging.devhelm.io" ]] || { echo "::error::DEVHELM_API_URL not set"; exit 1; }
- name: Verify DEVHELM_ORG_ID
run: |
[[ "$DEVHELM_ORG_ID" == "42" ]] || { echo "::error::DEVHELM_ORG_ID not set"; exit 1; }
- name: Verify DEVHELM_WORKSPACE_ID
run: |
[[ "$DEVHELM_WORKSPACE_ID" == "7" ]] || { echo "::error::DEVHELM_WORKSPACE_ID not set"; exit 1; }
test-no-env-when-empty:
name: No env vars when inputs are empty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-devhelm without auth inputs
uses: ./
- name: Verify no DEVHELM_API_TOKEN
run: |
[[ -z "$DEVHELM_API_TOKEN" ]] || { echo "::error::DEVHELM_API_TOKEN should not be set"; exit 1; }
- name: Verify no DEVHELM_ORG_ID
run: |
[[ -z "$DEVHELM_ORG_ID" ]] || { echo "::error::DEVHELM_ORG_ID should not be set"; exit 1; }
test-skip-node-setup:
name: Skip built-in Node setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Run setup-devhelm without auto Node
id: setup
uses: ./
with:
node-version: ''
- name: Verify Node version unchanged
run: |
NODE_V=$(node -v)
echo "Node version: $NODE_V"
[[ "$NODE_V" == v22.* ]] || { echo "::error::Expected Node 22.x, got $NODE_V"; exit 1; }
- name: Verify devhelm works
run: devhelm --help
test-macos:
name: Install on macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-devhelm
id: setup
uses: ./
- name: Verify CLI runs
run: devhelm --help
test-cache:
name: Cache behavior
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-devhelm
id: setup
uses: ./
- name: Report cache status
run: echo "Cache hit = ${{ steps.setup.outputs.cache-hit }}"