This repository was archived by the owner on Dec 21, 2022. It is now read-only.
Repository navigation
87 lines (83 loc) · 3.99 KB
/
Copy pathWebAutomatedTests.yml
File metadata and controls
87 lines (83 loc) · 3.99 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Run automated end-to-end tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
name: "Automated tests"
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
strategy:
# when one test fails, DO NOT cancel the other
fail-fast: false
matrix:
# run 3 copies of the current job in parallel
containers: [0, 1, 2]
steps:
- name: "Checking changed files"
id: files
uses: softprops/diffset@3aeca0719d5043522e155012d3c9f7470fdd2dc6 # v1
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
with:
global_files: |
!{packages/**/*,configs/e2e/*.json,detox/**/*,scripts/**/*,data/**/*}
not_atlas_native_files: |
!packages/theming/atlas/src/**/native/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Checking-out code"
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
with:
submodules: false
- name: "Fetching master to compare"
if: github.event_name == 'pull_request' && (steps.files.outputs.global_files == '' || github.event.pull_request.head.repo.full_name != github.repository)
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
- name: "Defining environment variables"
id: variables
run: echo ::set-output name=arg::$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '--since origin/${{ github.base_ref }}'; else echo ''; fi)
- name: "Defining cache"
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: "Defining node version"
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # v2
with:
node-version-file: ".nvmrc"
- name: "Installing dependencies"
run: npm install
- name: Login to GitHub Container Registry
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: docker/login-action@42d299face0c5c43a0487c477f595ac9cf22f1a7 # v1.12.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Executing E2E tests"
if: github.event_name == 'push' || steps.files.outputs.not_atlas_native_files != '' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
run: CIRCLE_NODE_INDEX=${{ matrix.containers }} npm run test:e2e -- ${{ steps.variables.outputs.arg }}
env:
FORKED: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
- name: "Fixing files permissions"
if: failure()
run: |
sudo find ${{ github.workspace }}/packages/* -type d -exec chmod 755 {} \;
sudo find ${{ github.workspace }}/packages/* -type f -exec chmod 644 {} \;
- name: "Archive test screenshot diff results"
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2
if: failure()
with:
name: test-screenshot-results
path: |
${{ github.workspace }}/packages/**/tests/e2e/screenshot-results/diff/**/*.png
${{ github.workspace }}/packages/**/tests/e2e/screenshot-results/TESTFAIL_*.png
${{ github.workspace }}/packages/**/cypress-visual-screenshots/diff/*.png
${{ github.workspace }}/packages/**/cypress-visual-screenshots/comparison/*.png
${{ github.workspace }}/packages/**/cypress/videos/*.mp4
if-no-files-found: error