9898 with :
9999 query : attr(tags, lint, tests(//java/...))
100100
101- chrome_tests :
101+ browser_tests :
102102 needs : small_tests
103103 runs-on : ubuntu-latest
104+ strategy :
105+ matrix :
106+ browser : [ chrome, firefox ]
104107 steps :
105108 - name : Checkout source tree
106109 uses : actions/checkout@v2
@@ -110,42 +113,9 @@ jobs:
110113 path : |
111114 ~/.cache/bazel-disk
112115 ~/.cache/bazel-repo
113- key : ${{ runner.os }}-bazel-chrome -tests-${{ hashFiles('**/BUILD.bazel') }}
116+ key : ${{ runner.os }}-bazel-${{ matrix.browser }} -tests-${{ hashFiles('**/BUILD.bazel') }}
114117 restore-keys : |
115- ${{ runner.os }}-bazel-chrome-tests-
116- ${{ runner.os }}-bazel-build-
117- - name : Setup bazelisk
118- uses : ./.github/actions/setup-bazelisk
119- - name : Setup Java
120- uses : actions/setup-java@v1
121- with :
122- java-version : ' 11'
123- - name : Setup Chrome and ChromeDriver
124- uses : ./.github/actions/setup-chrome
125- - name : Start XVFB
126- run : Xvfb :99 &
127- - name : Run browser tests in Chrome
128- uses : ./.github/actions/bazel-test
129- with :
130- query : attr(tags, chrome, tests(//java/...)) except attr(tags, remote, tests(//java/...))
131- env :
132- DISPLAY : :99
133-
134- firefox_tests :
135- needs : small_tests
136- runs-on : ubuntu-latest
137- steps :
138- - name : Checkout source tree
139- uses : actions/checkout@v2
140- - name : Cache Bazel artifacts
141- uses : actions/cache@v2
142- with :
143- path : |
144- ~/.cache/bazel-disk
145- ~/.cache/bazel-repo
146- key : ${{ runner.os }}-bazel-firefox-tests-${{ hashFiles('**/BUILD.bazel') }}
147- restore-keys : |
148- ${{ runner.os }}-bazel-firefox-tests-
118+ ${{ runner.os }}-bazel-${{ matrix.browser }}-tests-
149119 ${{ runner.os }}-bazel-build-
150120 - name : Setup bazelisk
151121 uses : ./.github/actions/setup-bazelisk
@@ -155,20 +125,24 @@ jobs:
155125 java-version : ' 11'
156126 - name : Setup Firefox and GeckoDriver
157127 uses : ./.github/actions/setup-firefox
128+ - name : Setup Chrome and ChromeDriver
129+ uses : ./.github/actions/setup-chrome
158130 - name : Start XVFB
159131 run : Xvfb :99 &
160- - name : Run browser tests in Firefox
132+ - name : Run browser tests in ${{ matrix.browser }}
161133 uses : ./.github/actions/bazel-test
162134 with :
163- query : attr(tags, firefox , tests(//java/...)) except attr(tags, 'rc|remote', tests(//java/...))
135+ query : attr(tags, ${{ matrix.browser }} , tests(//java/...)) except attr(tags, 'lint| rc|remote', tests(//java/...))
164136 env :
165137 DISPLAY : :99
166138
167-
168139 server_tests :
169140 if : ${{ always() }}
170- needs : [ chrome_tests, firefox_tests ]
141+ needs : [ browser_tests ]
171142 runs-on : ubuntu-latest
143+ strategy :
144+ matrix :
145+ browser : [ chrome, firefox ]
172146 steps :
173147 - name : Checkout source tree
174148 uses : actions/checkout@v2
@@ -178,28 +152,27 @@ jobs:
178152 path : |
179153 ~/.cache/bazel-disk
180154 ~/.cache/bazel-repo
181- key : ${{ runner.os }}-bazel-server-tests-${{ hashFiles('**/BUILD.bazel') }}
155+ key : ${{ runner.os }}-bazel-${{ matrix.browser }}- server-tests-${{ hashFiles('**/BUILD.bazel') }}
182156 restore-keys : |
183- ${{ runner.os }}-bazel-server-tests-
184- ${{ runner.os }}-bazel-chrome-tests-
185- ${{ runner.os }}-bazel-firefox-tests-
157+ ${{ runner.os }}-bazel-${{ matrix.browser }}-server-tests-
158+ ${{ runner.os }}-bazel-${{ matrix.browser }}-tests-
186159 ${{ runner.os }}-bazel-build-
187160 - name : Setup bazelisk
188161 uses : ./.github/actions/setup-bazelisk
189162 - name : Setup Java
190163 uses : actions/setup-java@v1
191164 with :
192165 java-version : ' 11'
193- - name : Setup Chrome and ChromeDriver
194- uses : ./.github/actions/setup-chrome
195166 - name : Setup Firefox and GeckoDriver
196167 uses : ./.github/actions/setup-firefox
168+ - name : Setup Chrome and ChromeDriver
169+ uses : ./.github/actions/setup-chrome
197170 - name : Start XVFB
198171 run : Xvfb :99 &
199172 - name : Run server tests
200173 uses : ./.github/actions/bazel-test
201174 with :
202- query : tests(//java/...) except attr(tags, 'rc|lint|ie|edge|edgehtml|safari ', tests(//java/...))
175+ query : attr(tags, ${{ matrix.browser }}, tests(//java/...)) intersect attr(tags, 'remote ', tests(//java/...))
203176 env :
204177 DISPLAY : :99
205178
0 commit comments