forked from envoyproxy/envoy-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (133 loc) · 4.79 KB
/
android_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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: android_tests
on:
push:
branches:
- main
pull_request:
jobs:
kotlintestsmac:
# revert to //test/kotlin/... once fixed
# https://github.com/envoyproxy/envoy-mobile/issues/1932
name: kotlin_tests_mac
runs-on: macos-12
timeout-minutes: 90
steps:
- uses: actions/checkout@v1
with:
submodules: true
- id: check_context
name: 'Check whether to run'
run: |
if git rev-parse --abbrev-ref HEAD | grep -q ^main$ || git diff --name-only origin/main | grep -qe common/ -e java/ -e kotlin/ -e bazel/ -e ^\.bazelrc$ -e ^envoy$ -e ^WORKSPACE$ -e ^.github/workflows/android_tests.yml$ ; then
echo "Tests will run."
echo "::set-output name=run_tests::true"
else
echo "Skipping tests."
echo "::set-output name=run_tests::false"
fi
- name: 'Java setup'
if: steps.check_context.outputs.run_tests == 'true'
uses: actions/setup-java@v1
with:
java-version: '8'
java-package: jdk
architecture: x64
- name: 'Install dependencies'
if: steps.check_context.outputs.run_tests == 'true'
run: ./ci/mac_ci_setup.sh
- name: 'Run Kotlin library tests'
if: steps.check_context.outputs.run_tests == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./bazelw test \
--test_output=all \
--build_tests_only \
--config=remote-ci-macos \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
//test/kotlin/io/...
javatestsmac:
name: java_tests_mac
runs-on: macos-12
timeout-minutes: 120
steps:
- uses: actions/checkout@v1
with:
submodules: true
- id: check_context
name: 'Check whether to run'
run: |
if git rev-parse --abbrev-ref HEAD | grep -q ^main$ || git diff --name-only origin/main | grep -qe common/ -e java/ -e kotlin/ -e bazel/ -e ^\.bazelrc$ -e ^envoy$ -e ^WORKSPACE$ -e ^.github/workflows/android_tests.yml$ ; then
echo "Tests will run."
echo "::set-output name=run_tests::true"
else
echo "Skipping tests."
echo "::set-output name=run_tests::false"
fi
- name: 'Java setup'
if: steps.check_context.outputs.run_tests == 'true'
uses: actions/setup-java@v1
with:
java-version: '8'
java-package: jdk
architecture: x64
- name: 'Install dependencies'
if: steps.check_context.outputs.run_tests == 'true'
run: ./ci/mac_ci_setup.sh
- name: 'Run Java library tests'
if: steps.check_context.outputs.run_tests == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./bazelw test \
--test_output=all \
--build_tests_only \
--config=remote-ci-macos \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
--define=signal_trace=disabled \
//test/java/...
kotlintestslinux:
# Only kotlin tests are executed since with linux:
# https://github.com/envoyproxy/envoy-mobile/issues/1418.
name: kotlin_tests_linux
runs-on: ubuntu-18.04
timeout-minutes: 90
container:
image: envoyproxy/envoy-build-ubuntu:0a02a76af5951bf7f4c7029c0ea6d29d96c0f682
env:
CC: /opt/llvm/bin/clang
CXX: /opt/llvm/bin/clang++
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy-mobile/envoy-mobile
- id: check_context
name: 'Check whether to run'
run: |
if git rev-parse --abbrev-ref HEAD | grep -q ^main$ || git diff --name-only origin/main | grep -qe common/ -e java/ -e kotlin/ -e bazel/ -e ^\.bazelrc$ -e ^envoy$ -e ^WORKSPACE$ -e ^.github/workflows/android_tests.yml$ ; then
echo "Tests will run."
echo "::set-output name=run_tests::true"
else
echo "Skipping tests."
echo "::set-output name=run_tests::false"
fi
- name: 'Java setup'
if: steps.check_context.outputs.run_tests == 'true'
uses: actions/setup-java@v1
with:
java-version: '8'
java-package: jdk
architecture: x64
- name: 'Run Kotlin library integration tests'
if: steps.check_context.outputs.run_tests == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./bazelw test \
--test_output=all \
--build_tests_only \
--config=remote-ci-linux-clang \
--remote_header="Authorization=Bearer $GITHUB_TOKEN" \
//test/kotlin/...