Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - run java tests with Firefox Dev Edition #39

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/setup-edge/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Setup Chrome and chromedriver'
runs:
using: "composite"
steps:
- run: |
sudo apt install wget software-properties-common apt-transport-https
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main"
sudo apt-get update -qqy
sudo apt-get -qqy install microsoft-edge-stable
EDGE_VERSION=$(microsoft-edge-stable --version)
EDGE_FULL_VERSION=${EDGE_VERSION%%.*}
EDGE_MAJOR_VERSION=${EDGE_FULL_VERSION//[!0-9]}

MS_STORAGE=https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver
echo ${MS_STORAGE}/LATEST_RELEASE_${EDGE_MAJOR_VERSION}_LINUX
EDGEDRIVER_VERSION=`curl -s ${MS_STORAGE}/LATEST_RELEASE_${EDGE_MAJOR_VERSION}_LINUX | LC_CTYPE=C tr -cd [.0-9]`
echo $EDGEDRIVER_VERSION
echo ${MS_STORAGE}/${EDGEDRIVER_VERSION}/edgedriver_linux64.zip
curl -LO ${MS_STORAGE}/${EDGEDRIVER_VERSION}/edgedriver_linux64.zip

unzip edgedriver_linux64.zip && chmod +x msedgedriver && sudo mv msedgedriver /usr/local/bin
msedgedriver -version
shell: bash
191 changes: 40 additions & 151 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,99 +13,16 @@ env:
NODE_VERSION: '13.x'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v2
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-build-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Build grid
uses: ./.github/actions/bazel
with:
command: build grid

small_tests:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-small-tests-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-small-tests-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Run small tests
uses: ./.github/actions/bazel-test
with:
query: attr(size, small, tests(//java/...)) except attr(tags, lint, tests(//java/...))
- name: Sonar Scanner
uses: ./.github/actions/sonar-cloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

lint:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v2
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-lint-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-lint-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Run linter
uses: ./.github/actions/bazel-test
with:
query: attr(tags, lint, tests(//java/...))

browser_tests:
needs: small_tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [ chrome, firefox ]
browser: [ chrome, firefox, edge ]
version: [ latest ]
include:
- browser: 'firefox'
version: 'latest-devedition'
steps:
- name: Checkout source tree
uses: actions/checkout@v2
Expand All @@ -125,10 +42,24 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup Firefox and GeckoDriver
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
if: |
matrix.browser == 'firefox'
with:
firefox-version: ${{ matrix.version }}
- name: Setup GeckoDriver
uses: ./.github/actions/setup-firefox
if: |
matrix.browser == 'firefox'
- name: Setup Chrome and ChromeDriver
uses: ./.github/actions/setup-chrome
if: |
matrix.browser == 'chrome'
- name: Setup EdgeDriver
uses: ./.github/actions/setup-edge
if: |
matrix.browser == 'edge'
- name: Start XVFB
run: Xvfb :99 &
- name: Run browser tests in ${{ matrix.browser }}
Expand All @@ -140,12 +71,15 @@ jobs:
DISPLAY: :99

server_tests:
needs: small_tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [ chrome, firefox ]
browser: [ chrome, firefox, edge ]
version: [ latest ]
include:
- browser: 'firefox'
version: 'latest-devedition'
steps:
- name: Checkout source tree
uses: actions/checkout@v2
Expand All @@ -166,10 +100,24 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup Firefox and GeckoDriver
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
if: |
matrix.browser == 'firefox'
with:
firefox-version: ${{ matrix.version }}
- name: Setup GeckoDriver
uses: ./.github/actions/setup-firefox
if: |
matrix.browser == 'firefox'
- name: Setup Chrome and ChromeDriver
uses: ./.github/actions/setup-chrome
if: |
matrix.browser == 'chrome'
- name: Setup EdgeDriver
uses: ./.github/actions/setup-edge
if: |
matrix.browser == 'edge'
- name: Start XVFB
run: Xvfb :99 &
- name: Run server tests
Expand All @@ -180,62 +128,3 @@ jobs:
env:
DISPLAY: :99

rc_tests:
needs: small_tests
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v2
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-firefox-tests-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-firefox-tests-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup Firefox and GeckoDriver
uses: ./.github/actions/setup-firefox
- name: Start XVFB
run: Xvfb :99 &
- name: Run browser tests in Firefox
uses: ./.github/actions/bazel-test
with:
query: attr(tags, rc, tests(//java/...))
attempts: 3
env:
DISPLAY: :99

javadoc:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v2
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-firefox-tests-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-firefox-tests-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Generate javadoc
run: |
./go --verbose javadocs