This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
71 lines (64 loc) · 2.34 KB
/
run_e2e_tests.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
name: Run E2E Tests
on:
push:
branches: [main]
pull_request:
paths:
- "puppet/**"
workflow_dispatch:
jobs:
publish_to_saucelabs:
defaults:
run:
working-directory: puppet
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Detect version from release tag
run: |
echo "CI_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Create APK Release
- name: Build apk release project (APK) - ${{ env.main_project_module }} module
env:
SAUCE_ACCESS_KEY: '${{ secrets.SAUCE_ACCESS_KEY}}'
SAUCE_USERNAME: '${{ secrets.SAUCE_USERNAME}}'
run: |
./gradlew assemble
set -x
echo "app/build/outputs/apk/release/app-release-unsigned-$GITHUB_REF_NAME.apk"
mv app/build/outputs/apk/release/app-release-unsigned.apk "app/build/outputs/apk/release/app-release-unsigned-$GITHUB_REF_NAME.apk"
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/v1/storage/upload' \
--form 'payload=@app/build/outputs/apk/release/app-release-unsigned-'"$GITHUB_REF_NAME"'.apk' \
--form 'name=app-release-unsigned-'"$GITHUB_REF_NAME"'.apk'
test:
needs: [publish_to_saucelabs]
defaults:
run:
working-directory: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11.4'
cache: 'pip'
- name: pip Install
run: pip install -r requirements.txt
- name: Run Tests
run: python test_sauce_labs.py
env:
SAUCE_ACCESS_KEY: '${{ secrets.SAUCE_ACCESS_KEY}}'
SAUCE_USERNAME: '${{ secrets.SAUCE_USERNAME}}'
TEST_UUID: '${{ secrets.TEST_UUID}}'
PRE_RELEASE_APK: 'app-release-unsigned-${{ github.ref_name }}.apk'