-
Notifications
You must be signed in to change notification settings - Fork 23
64 lines (53 loc) · 2.13 KB
/
Copy pathL1-tests.yml
File metadata and controls
64 lines (53 loc) · 2.13 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
name: L1 Unit Tests
on:
pull_request:
branches: [ develop ]
env:
AUTOMATICS_UNAME: ${{ secrets.AUTOMATICS_UNAME }}
AUTOMATICS_PASSCODE: ${{ secrets.AUTOMATICS_PASSCODE }}
jobs:
execute-L1-tests-on-pr:
name: Execute L1 test suite in test container environment
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull test container image
run: docker pull ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest
- name: Start test container
run: |
docker run -d --name native-platform -v ${{ github.workspace }}:/mnt/L1_CONTAINER_SHARED_VOLUME ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest
- name: Run L1 Unit Tests inside container
run: docker exec -i native-platform /bin/bash -c "cd /mnt/L1_CONTAINER_SHARED_VOLUME/ && sh test/run_ut.sh"
- name: Copy L1 test results to runner
run: |
docker cp native-platform:/tmp/Gtest_Report /tmp/Gtest_Report
ls -l /tmp/Gtest_Report
upload-test-results:
name: Upload L1 test results to automatic test result management system
needs: execute-L1-tests-on-pr
runs-on: ubuntu-latest
container:
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
volumes:
- /tmp/Gtest_Report:/tmp/Gtest_Report
steps:
- name: Upload results
if: github.repository_owner == 'rdkcentral'
env:
TEST_RESULTS_PUSH_URL: ${{ secrets.TEST_RESULTS_PUSH_URL }}
run: |
echo "Contents in /tmp/Gtest_Report:"
ls -l /tmp/Gtest_Report
if [ -z "${TEST_RESULTS_PUSH_URL}" ]; then
echo "TEST_RESULTS_PUSH_URL secret not set. Skipping test result upload."
exit 0
fi
git config --global --add safe.directory `pwd`
gtest-json-result-push.py /tmp/Gtest_Report "${TEST_RESULTS_PUSH_URL}" `pwd`