-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
77 lines (69 loc) · 2.13 KB
/
action.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
name: "Run Playwright tests"
description: "Runs Playwright end-to-end tests in CI"
inputs:
github_token:
description: "Github token"
required: true
url:
description: "Name of the test url (dev, staging, prod, custom)"
required: false
default: dev
customUrl:
description: "Url of custom env (PR deploy, dev/prod env)"
required: false
tests:
description: "Tests to run"
required: true
workers:
description: "Numbers of worker threads to be spawned"
required: false
default: "2"
ref:
description: "`ref` param for actions/checkout"
required: false
secret_name:
description: "Name of the secret in aws secret manager"
required: true
runs:
using: "composite"
steps:
- name: Show action's inputs
shell: bash
run: |
echo "github_token=${{ inputs.github_token }}"
echo "url=${{ inputs.url }}"
echo "customUrl=${{ inputs.customUrl }}"
echo "tests=${{ inputs.tests }}"
echo "workers=${{ inputs.workers }}"
echo "ref=${{ inputs.ref }}"
- name: Checkout
uses: actions/checkout@v4
with:
repository: "Bowery-RES/webapp-ui-automation-pw"
token: ${{ inputs.github_token }}
ref: ${{ inputs.ref }}
- name: Setup node to lts
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Dependencies
uses: bahmutov/npm-install@v1.8.36
- name: Install Playwright Browsers (Chromium ONLY)
shell: bash
run: npx playwright install chromium
- name: Authenticate with private NPM package
shell: bash
run: echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" > ~/.npmrc
- name: Set secrets to GH environment
if: ${{ !env.ACT }}
uses: Bowery-RES/action-aws-secrets@v1
with:
secrets: |
${{ inputs.secret_name }}
namespace: false
- name: Run Playwright end-to-end tests
run: npm run test:ci -- ${{ inputs.tests }} --workers ${{ inputs.workers }}
shell: bash
env:
ENV: ${{ inputs.url }}
URL: ${{ inputs.customUrl == '' && '' || inputs.customUrl }}