-
Notifications
You must be signed in to change notification settings - Fork 5
80 lines (79 loc) · 3.31 KB
/
siteminder-tests.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
74
75
76
77
78
79
80
name: Run siteminder tests to validate saml payload
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment under test'
required: true
default: 'PROD'
type: choice
options: ['DEV', 'TEST', 'PROD']
cluster:
description: 'OCP'
required: true
default: 'GOLD'
type: choice
options: ['GOLD', 'SILVER']
jobs:
run-siteminder-tests:
name: ${{ matrix.name }}
runs-on: ubuntu-20.04
strategy:
matrix:
name: ['KAMLOOPS', 'CALGARY']
max-parallel: 1
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Generate env file
run: |
cd ${{ github.workspace }}/cy-siteminder-tests
echo "${{ secrets.SITEMINDER_TESTS_ENV }}" | base64 --decode > .env
- name: Set up docker buildx
uses: docker/setup-buildx-action@v3
- name: Cache docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-test-cache
key: ${{ runner.os }}-buildx-test-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-test-
- name: Build docker image
uses: docker/build-push-action@v5
with:
context: cy-siteminder-tests/
push: false
load: true
tags: siteminder-tests
cache-from: type=local,src=/tmp/.buildx-test-cache
cache-to: type=local,dest=/tmp/.buildx-test-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-test-cache
mv /tmp/.buildx-test-cache-new /tmp/.buildx-test-cache
- name: Run siteminder tests
env:
HOST_ENTRY: ${{ github.event.inputs.environment }}_IDIM_${{ matrix.name }}_HOST
run: |
cd ${{ github.workspace }}/cy-siteminder-tests
docker run --rm -e ENVIRONMENT=${{ github.event.inputs.environment }} \
-e CLUSTER=${{ github.event.inputs.cluster }} \
-v $(pwd)/results:/e2e/results \
--add-host=${{ secrets[env.HOST_ENTRY] }} \
siteminder-tests
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.inputs.cluster }}-${{ github.event.inputs.environment }}-${{ matrix.name }}-RESULTS
path: ${{ github.workspace }}/cy-siteminder-tests/results
- name: Rocket.Chat Notification
if: failure()
uses: fjogeleit/http-request-action@v1
with:
url: ${{ secrets.SSO_ALERTS }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"text": "Siteminder Tests Failed! @jsharman @jlanglois @Marco @nithinshekar.kuruba", "attachments": [{"color": "#FF0000","author_name": "${{ github.actor }}", "title": "Failed test", "title_link": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", "text": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", "fields": [{"title": "Environment", "value": "${{ github.event.inputs.environment }}", "short": false}, {"title": "Cluster", "value": "${{ github.event.inputs.cluster }}", "short": false}]}]}'