-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (65 loc) · 2.57 KB
/
Copy pathtest.yml
File metadata and controls
66 lines (65 loc) · 2.57 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
name: Test
on:
push:
workflow_dispatch:
inputs:
branch:
required: false
type: string
default: master
permissions:
contents: read
jobs:
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions-ecosystem/action-regex-match@9e6c4fb3d5e898f505be7a1fb6e7b0a278f6665b # v2.0.2
id: regex-match
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
text: ${{ github.event.inputs.branch }}
regex: '^[a-zA-Z0-9_/\-]+$'
- name: Break on invalid branch name
run: exit 1
if: ${{ github.event_name == 'workflow_dispatch' && steps.regex-match.outputs && steps.regex-match.outputs.match == '' }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: v1/${{ runner.os }}/node-${{ matrix.node }}/${{ hashFiles('**/yarn.lock') }}
restore-keys: v1/${{ runner.os }}/node-${{ matrix.node }}/
- run: yarn
# Pin geckodriver for CI only — modern geckodriver (>=0.31) requires
# W3C capabilities, which selenium-webdriver 3.x (bundled with
# Protractor 7) does not send. Done here rather than in the npm
# `install` lifecycle so the pin doesn't leak into consumer installs.
- run: npx webdriver-manager update --no-chrome --no-standalone --versions.gecko=v0.30.0
- name: Set up @percy/cli from git
if: ${{ github.event_name == 'workflow_dispatch' }}
env:
CLI_BRANCH: ${{ github.event.inputs.branch }}
run: |
cd /tmp
git clone --branch "$CLI_BRANCH" --depth 1 https://github.com/percy/cli
cd cli
PERCY_PACKAGES=`find packages -mindepth 1 -maxdepth 1 -type d | sed -e 's/packages/@percy/g' | tr '\n' ' '`
git log -1
yarn
yarn build
yarn global:link
cd "$GITHUB_WORKSPACE"
yarn remove @percy/cli && yarn link `echo $PERCY_PACKAGES`
npx webdriver-manager update --no-chrome --no-standalone --versions.gecko=v0.30.0
npx percy --version
- run: yarn test:coverage