-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (83 loc) · 3.12 KB
/
saml.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
81
82
83
84
85
86
87
88
89
# Workflow starts automatically on push or can be triggered manually.
# This is a desirable pattern as it allows for adhoc test runs without a code push
name: user-search
on: [workflow_dispatch, repository_dispatch]
jobs:
sso-request-tests:
runs-on: ubuntu-latest
# In order for Cypress to run well, it needs to be fed the needed parameters.
# The below is a mix of Cypress environment variables (All capital) and ones that are needed for this specific set of scripts (Mix of capital and lowercase)
env:
CYPRESS_username: ${{ secrets.CYPRESS_USER_NAME }}
CYPRESS_password: ${{ secrets.CYPRESS_PASSWORD }}
CYPRESS_BASE_URL: 'http://localhost:8080'
CYPRESS_host: 'http://localhost:8080'
CYPRESS_guid: ${{ secrets.CYPRESS_GUID }}
CYPRESS_ENVIRONMENT: ${{ github.base_ref }}
CYPRESS_loginproxy: ${{ secrets.CYPRESS_LOGINPROXY }}
CYPRESS_siteminder: ${{ secrets.CYPRESS_SITEMINDER }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
SERVER_HOST: 'localhost'
SERVER_PORT: 8080
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
steps:
# Checkout the PR branch
- name: Checkout Target Branch
uses: actions/checkout@v3
- name: Checkout SAML Playground
uses: actions/checkout@v3
with:
repository: bcgov/keycloak-example-apps
path: saml
# We are cache-ing our node modules to slightly speed up execution in the future.
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Build and Run SAML Playground
run: |
npm install
yarn
yarn build
yarn local &
working-directory: ./saml/examples/saml/public/node
- name: SAML Test
uses: cypress-io/github-action@v6.6.0
id: saml
continue-on-error: false
with:
summary-title: 'SAML tests'
wait-on: ${{ secrets.CYPRESS_HOST }}
wait-on-timeout: 120
record: true
install-command: npm ci
working-directory: testing
spec: |
cypress/e2e/**/saml-010-main.cy.ts
browser: chrome
# project: ./e2e
ci-build-id: ${{ github.event.number }}
- name: Run the reports
run: |
cd testing
npm run report
- name: Upload Test Reports
uses: actions/upload-artifact@v3
with:
name: test-results
path: testing/mochawesome-report/report.html