|
3 | 3 | branches: |
4 | 4 | - master |
5 | 5 | pull_request: |
| 6 | + branches: |
| 7 | + - master |
6 | 8 |
|
7 | 9 | jobs: |
8 | 10 | build: |
9 | 11 | runs-on: ubuntu-latest |
10 | 12 | steps: |
11 | 13 | - uses: actions/checkout@v1 |
| 14 | + |
12 | 15 | - uses: actions/setup-node@v1 |
13 | 16 | with: |
14 | 17 | node-version: '' |
15 | | - - name: setup npm cache |
| 18 | + |
| 19 | + - name: Setup NPM Cache |
16 | 20 | uses: actions/cache@v1 |
17 | 21 | with: |
18 | 22 | path: ~/.npm |
19 | 23 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
20 | 24 | restore-keys: | |
21 | 25 | ${{ runner.os }}-node- |
22 | | - - name: npm install |
| 26 | +
|
| 27 | + - name: NPM Install |
23 | 28 | run: npm ci |
24 | | - - name: npm build |
| 29 | + |
| 30 | + - name: NPM Build |
25 | 31 | run: npm run build |
26 | | - - name: npm run test |
| 32 | + |
| 33 | + - name: NPM Run Test |
27 | 34 | run: npm run test |
28 | 35 |
|
29 | | - integration: |
| 36 | + integrationOSS: |
30 | 37 | runs-on: ubuntu-latest |
31 | 38 |
|
32 | | - services: |
33 | | - vaultBasic: |
34 | | - image: vault:1.2.3 |
35 | | - ports: |
36 | | - - 8200/tcp |
37 | | - env: |
38 | | - VAULT_DEV_ROOT_TOKEN_ID: testtoken |
39 | | - options: --cap-add=IPC_LOCK |
40 | | - vaultEnterprise: |
41 | | - image: hashicorp/vault-enterprise:1.3.0_ent |
42 | | - ports: |
43 | | - - 8200/tcp |
44 | | - env: |
45 | | - VAULT_DEV_ROOT_TOKEN_ID: testtoken |
46 | | - options: --cap-add=IPC_LOCK |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v1 |
| 41 | + |
| 42 | + - name: Run docker-compose |
| 43 | + run: docker-compose up -d vault |
| 44 | + |
| 45 | + - uses: actions/setup-node@v1 |
| 46 | + with: |
| 47 | + node-version: '' |
| 48 | + |
| 49 | + - name: Setup NPM Cache |
| 50 | + uses: actions/cache@v1 |
| 51 | + with: |
| 52 | + path: ~/.npm |
| 53 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 54 | + restore-keys: | |
| 55 | + ${{ runner.os }}-node- |
| 56 | +
|
| 57 | + - name: NPM Install |
| 58 | + run: npm ci |
| 59 | + |
| 60 | + - name: NPM Build |
| 61 | + run: npm run build |
| 62 | + |
| 63 | + - name: NPM Run test;integration:basic |
| 64 | + run: npm run test:integration:basic |
| 65 | + env: |
| 66 | + VAULT_HOST: localhost |
| 67 | + VAULT_PORT: 8200 |
| 68 | + CI: true |
| 69 | + |
| 70 | + integrationEnterprise: |
| 71 | + runs-on: ubuntu-latest |
47 | 72 |
|
48 | 73 | steps: |
49 | | - - uses: actions/checkout@v1 |
50 | | - - uses: actions/setup-node@v1 |
51 | | - with: |
52 | | - node-version: '' |
53 | | - - name: setup npm cache |
54 | | - uses: actions/cache@v1 |
55 | | - with: |
56 | | - path: ~/.npm |
57 | | - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
58 | | - restore-keys: | |
59 | | - ${{ runner.os }}-node- |
60 | | - - name: npm install |
61 | | - run: npm ci |
62 | | - - name: npm build |
63 | | - run: npm run build |
64 | | - - name: npm run test:integration:basic |
65 | | - run: npm run test:integration:basic |
66 | | - env: |
67 | | - VAULT_HOST: localhost |
68 | | - VAULT_PORT: ${{ job.services.vaultBasic.ports[8200] }} |
69 | | - CI: true |
70 | | - - name: npm run test:integration:enterprise |
71 | | - run: npm run test:integration:enterprise |
72 | | - env: |
73 | | - VAULT_HOST: localhost |
74 | | - VAULT_PORT: ${{ job.services.vaultEnterprise.ports[8200] }} |
75 | | - CI: true |
| 74 | + - uses: actions/checkout@v1 |
| 75 | + |
| 76 | + - name: Run docker-compose |
| 77 | + run: docker-compose up -d vault-enterprise |
| 78 | + |
| 79 | + - uses: actions/setup-node@v1 |
| 80 | + with: |
| 81 | + node-version: '' |
| 82 | + |
| 83 | + - name: Setup NPM Cache |
| 84 | + uses: actions/cache@v1 |
| 85 | + with: |
| 86 | + path: ~/.npm |
| 87 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 88 | + restore-keys: | |
| 89 | + ${{ runner.os }}-node- |
| 90 | +
|
| 91 | + - name: NPM Install |
| 92 | + run: npm ci |
| 93 | + |
| 94 | + - name: NPM Build |
| 95 | + run: npm run build |
| 96 | + |
| 97 | + - name: NPM Run test:intergration:enterprise |
| 98 | + run: npm run test:integration:enterprise |
| 99 | + env: |
| 100 | + VAULT_HOST: localhost |
| 101 | + VAULT_PORT: 8200 |
| 102 | + CI: true |
76 | 103 |
|
77 | 104 | e2e: |
78 | 105 | runs-on: ubuntu-latest |
79 | 106 |
|
80 | | - services: |
81 | | - vault: |
82 | | - image: vault:1.3.0 |
83 | | - ports: |
84 | | - - 8200/tcp |
85 | | - env: |
86 | | - VAULT_DEV_ROOT_TOKEN_ID: testtoken |
87 | | - options: --cap-add=IPC_LOCK |
88 | | - |
89 | 107 | steps: |
90 | 108 | - uses: actions/checkout@v1 |
| 109 | + |
| 110 | + - name: Run docker-compose |
| 111 | + run: docker-compose up -d vault |
| 112 | + |
91 | 113 | - uses: actions/setup-node@v1 |
92 | 114 | with: |
93 | 115 | node-version: '' |
94 | | - - name: setup npm cache |
| 116 | + |
| 117 | + - name: Setup NPM Cache |
95 | 118 | uses: actions/cache@v1 |
96 | 119 | with: |
97 | 120 | path: ~/.npm |
98 | 121 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
99 | 122 | restore-keys: | |
100 | 123 | ${{ runner.os }}-node- |
101 | | - - name: npm install |
| 124 | +
|
| 125 | + - name: NPM Install |
102 | 126 | run: npm ci |
103 | | - - name: npm build |
| 127 | + |
| 128 | + - name: NPM Build |
104 | 129 | run: npm run build |
105 | | - - name: setup vault |
| 130 | + |
| 131 | + - name: Setup Vault |
106 | 132 | run: node ./integrationTests/e2e/setup.js |
107 | 133 | env: |
108 | 134 | VAULT_HOST: localhost |
109 | | - VAULT_PORT: ${{ job.services.vault.ports[8200] }} |
110 | | - - name: use vault action (default K/V version 2) |
| 135 | + VAULT_PORT: 8200 |
| 136 | + |
| 137 | + - name: Test Vault Action (default KV V2) |
111 | 138 | uses: ./ |
112 | 139 | id: kv-secrets |
113 | 140 | with: |
114 | | - url: http://localhost:${{ job.services.vault.ports[8200] }} |
| 141 | + url: http://localhost:8200 |
115 | 142 | token: testtoken |
116 | 143 | secrets: | |
117 | 144 | test secret ; |
118 | 145 | test secret | NAMED_SECRET ; |
119 | 146 | nested/test otherSecret ; |
120 | | - - name: use vault action (custom K/V version 1) |
| 147 | +
|
| 148 | + - name: Test Vault Action (default KV V1) |
121 | 149 | uses: ./ |
122 | 150 | with: |
123 | | - url: http://localhost:${{ job.services.vault.ports[8200] }} |
| 151 | + url: http://localhost:8200 |
124 | 152 | token: testtoken |
125 | 153 | path: my-secret |
126 | 154 | kv-version: 1 |
127 | 155 | secrets: | |
128 | 156 | test altSecret ; |
129 | 157 | test altSecret | NAMED_ALTSECRET ; |
130 | 158 | nested/test otherAltSecret ; |
131 | | - - name: use vault action (using cubbyhole engine) |
| 159 | +
|
| 160 | + - name: Test Vault Action (cubbyhole) |
132 | 161 | uses: ./ |
133 | 162 | with: |
134 | | - url: http://localhost:${{ job.services.vault.ports[8200] }} |
| 163 | + url: http://localhost:8200 |
135 | 164 | token: testtoken |
136 | 165 | secrets: | |
137 | 166 | /cubbyhole/test foo ; |
138 | 167 | /cubbyhole/test zip | NAMED_CUBBYSECRET ; |
139 | | - - name: verify |
| 168 | +
|
| 169 | + - name: Verify Vault Action Outputs |
140 | 170 | run: npm run test:e2e |
141 | 171 | env: |
142 | 172 | OTHER_SECRET_OUTPUT: ${{ steps.kv-secrets.outputs.otherSecret }} |
143 | 173 |
|
| 174 | + e2e-tls: |
| 175 | + runs-on: ubuntu-latest |
| 176 | + |
| 177 | + steps: |
| 178 | + - uses: actions/checkout@v1 |
| 179 | + |
| 180 | + - name: Run docker-compose |
| 181 | + run: docker-compose up -d vault-tls |
| 182 | + |
| 183 | + - uses: actions/setup-node@v1 |
| 184 | + with: |
| 185 | + node-version: '' |
| 186 | + |
| 187 | + - name: Setup NPM Cache |
| 188 | + uses: actions/cache@v1 |
| 189 | + with: |
| 190 | + path: ~/.npm |
| 191 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 192 | + restore-keys: | |
| 193 | + ${{ runner.os }}-node- |
| 194 | +
|
| 195 | + - name: NPM Install |
| 196 | + run: npm ci |
| 197 | + |
| 198 | + - name: NPM Build |
| 199 | + run: npm run build |
| 200 | + |
| 201 | + - name: Setup Vault |
| 202 | + run: node ./integrationTests/e2e-tls/setup.js |
| 203 | + env: |
| 204 | + VAULT_HOST: localhost |
| 205 | + VAULT_PORT: 8200 |
| 206 | + VAULTCA: ${{ secrets.VAULTCA }} |
| 207 | + VAULT_CLIENT_CERT: ${{ secrets.VAULT_CLIENT_CERT }} |
| 208 | + VAULT_CLIENT_KEY: ${{ secrets.VAULT_CLIENT_KEY }} |
| 209 | + |
| 210 | + - name: Test Vault Action (default KV V2) |
| 211 | + uses: ./ |
| 212 | + id: kv-secrets |
| 213 | + with: |
| 214 | + url: https://localhost:8200 |
| 215 | + token: ${{ env.VAULT_TOKEN }} |
| 216 | + caCertificate: ${{ secrets.VAULTCA }} |
| 217 | + clientCertificate: ${{ secrets.VAULT_CLIENT_CERT }} |
| 218 | + clientKey: ${{ secrets.VAULT_CLIENT_KEY }} |
| 219 | + secrets: | |
| 220 | + test secret ; |
| 221 | + test secret | NAMED_SECRET ; |
| 222 | + nested/test otherSecret ; |
| 223 | +
|
| 224 | + - name: Test Vault Action (default KV V1) |
| 225 | + uses: ./ |
| 226 | + with: |
| 227 | + url: https://localhost:8200 |
| 228 | + token: ${{ env.VAULT_TOKEN }} |
| 229 | + path: my-secret |
| 230 | + kv-version: 1 |
| 231 | + caCertificate: ${{ secrets.VAULTCA }} |
| 232 | + clientCertificate: ${{ secrets.VAULT_CLIENT_CERT }} |
| 233 | + clientKey: ${{ secrets.VAULT_CLIENT_KEY }} |
| 234 | + secrets: | |
| 235 | + test altSecret ; |
| 236 | + test altSecret | NAMED_ALTSECRET ; |
| 237 | + nested/test otherAltSecret ; |
| 238 | +
|
| 239 | + - name: Test Vault Action (cubbyhole) |
| 240 | + uses: ./ |
| 241 | + with: |
| 242 | + url: https://localhost:8200 |
| 243 | + token: ${{ env.VAULT_TOKEN }} |
| 244 | + secrets: | |
| 245 | + /cubbyhole/test foo ; |
| 246 | + /cubbyhole/test zip | NAMED_CUBBYSECRET ; |
| 247 | + caCertificate: ${{ secrets.VAULTCA }} |
| 248 | + clientCertificate: ${{ secrets.VAULT_CLIENT_CERT }} |
| 249 | + clientKey: ${{ secrets.VAULT_CLIENT_KEY }} |
| 250 | + |
| 251 | + - name: Verify Vault Action Outputs |
| 252 | + run: npm run test:e2e-tls |
| 253 | + env: |
| 254 | + OTHER_SECRET_OUTPUT: ${{ steps.kv-secrets.outputs.otherSecret }} |
| 255 | + |
144 | 256 | # Removing publish step for now. |
145 | 257 | # publish: |
146 | 258 | # if: github.event_name == 'push' && contains(github.ref, 'master') |
|
0 commit comments