forked from mendix/native-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNativeAutomatedTestsAndroid.yml
More file actions
95 lines (92 loc) · 4.09 KB
/
NativeAutomatedTestsAndroid.yml
File metadata and controls
95 lines (92 loc) · 4.09 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
88
89
90
91
92
93
94
95
name: Run native automated end-to-end tests for Android
on:
workflow_dispatch
# push:
# branches: [main]
# paths: "packages/pluggableWidgets/*-native/**/*"
# pull_request:
# branches: [main]
# paths: "packages/pluggableWidgets/*-native/**/*"
jobs:
native_automated_tests_android:
name: "Native automated tests for Android"
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
steps:
# - name: "Checking changed files"
# id: files
# uses: softprops/diffset@d5947696689a571f7a984a52505e2649eead5c22 # v1
# if:
# github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name ==
# github.repository
# with:
# base: main
# global_files: |
# !{packages/**/*,configs/e2e/*.json,detox/**/*,scripts/**/*}
# not_atlas_native_files: |
# !packages/theming/atlas/src/**/native/**
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Checking-out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
submodules: false
- name: "Fetching main to compare"
if: github.event_name == 'pull_request' && 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'; else echo
# ''; fi)
- name: "Get yarn cache directory path"
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }}
- name: "Defining cache"
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
env:
cache-name: cache-node-modules
with:
path: ${{ env.dir }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- name: "Defining node version"
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version-file: ".nvmrc"
- name: "Installing dependencies"
run: yarn 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: "Start Mendix Environment and run tests"
run: yarn start:native-tests-ci
# - name: "Executing E2E tests"
# if:
# github.event_name == 'push' || (github.event_name == 'pull_request' &&
# github.event.pull_request.head.repo.full_name != github.repository)
# run: yarn test:e2e -- --since
# 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/**/e2e/images/diffs/**/*.png
${{ github.workspace }}/packages/**/e2e/images/actual/**/*.png
if-no-files-found: error