Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit 79f1d1f

Browse files
committed
Fixed pipeline
1 parent 83ed989 commit 79f1d1f

File tree

2 files changed

+59
-20
lines changed

2 files changed

+59
-20
lines changed

.github/workflows/maven.yml

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Java CI
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
branches:
8+
- develop
9+
- selenium4
10+
411

512
jobs:
613
build_and_test:
@@ -9,17 +16,24 @@ jobs:
916
matrix:
1017
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
1118
java-version: [ 8 ]
12-
browser: ['jbrowser', 'googlechromeheadless', 'firefoxheadless'] # 'htmlunitwithjs' not working with Selenium4
19+
browser: ['jbrowser', 'googlechromeheadless', 'firefoxheadless', 'edgeheadless'] # 'htmlunitwithjs' not working with Selenium4
1320
include:
1421
- os: ubuntu-latest
1522
set_display: export DISPLAY=:99; Xvfb :99 -screen 0 1024x768x24 -ac -noreset & sleep 3
16-
install_dependencies: sudo apt-get -y -q install xvfb zip curl
23+
install_dependencies: |
24+
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
25+
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
26+
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
27+
sudo rm microsoft.gpg
28+
sudo apt update
29+
sudo apt-get -y -q install xvfb zip curl microsoft-edge-beta
1730
- os: windows-latest
1831
install_dependencies: choco install firefox googlechrome curl zip -y --no-progress
1932
- os: macos-latest
2033
install_dependencies: |
21-
brew cask install firefox
22-
brew cask install google-chrome
34+
brew install --cask firefox
35+
brew install --cask google-chrome
36+
brew install --cask microsoft-edge
2337
brew install zip
2438
brew install curl
2539
@@ -28,49 +42,66 @@ jobs:
2842
steps:
2943
- uses: actions/checkout@v2
3044
- name: Set up JDK ${{ matrix.java-version }}
31-
uses: actions/setup-java@v1.2.0
45+
uses: actions/setup-java@v2.3.0
3246
with:
47+
distribution: zulu
3348
java-version: ${{ matrix.java-version }}
3449
java-package: jdk+fx # needed for jbrowser
3550
- name: Set up other dependencies
3651
run: |
3752
${{ matrix.install_dependencies }}
3853
${{ matrix.set_display }}
3954
- name: Build with Maven
40-
run: mvn -B verify --file pom.xml -P 'build,${{ matrix.browser }}'
55+
run: mvn -B -ntp -q verify --file pom.xml -P 'build,${{ matrix.browser }}'
4156
- name: Delete output.xml (on Win)
4257
run: |
4358
Get-ChildItem target/robotframework-reports -Include *output.xml -Recurse | Remove-Item
44-
echo "::set-env name=REPORT_FILE::$(Get-ChildItem target/robotframework-reports -Include *report.html -Recurse -Name)"
59+
echo "REPORT_FILE=$(Get-ChildItem target/robotframework-reports -Include *report.html -Recurse -Name)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4560
if: always() && runner.os == 'Windows'
4661

4762
- name: Delete output.xml (on Unix-like)
4863
run: |
4964
find target/robotframework-reports -type f -name '*output.xml' -exec rm {} +
50-
echo "::set-env name=REPORT_FILE::$(find target/robotframework-reports -type f -name '*report.html' | sed 's#.*/##')"
65+
echo "REPORT_FILE=$(find target/robotframework-reports -type f -name '*report.html' | sed 's#.*/##')" >> $GITHUB_ENV
5166
if: always() && runner.os != 'Windows'
5267

5368
- name: Archive acceptances test results
54-
uses: actions/upload-artifact@v1.0.0
69+
uses: actions/upload-artifact@v2.2.4
5570
with:
5671
name: at-results-${{ matrix.browser }}-${{ matrix.os }}-${{ matrix.java-version }}
5772
path: target/robotframework-reports
5873
if: always() && job.status == 'failure'
5974

60-
- name: Upload results
75+
- name: Upload results on failure
76+
id: upload_results
6177
run: |
6278
echo '<html><head><meta http-equiv = "refresh" content =" 0 ; url = /${{ env.REPORT_FILE }}"></head></html>' > target/robotframework-reports/index.html
6379
zip -r -j site.zip target/robotframework-reports > no_output 2>&1
6480
curl -s -H "Content-Type: application/zip" -H "Authorization: Bearer ${{ secrets.NETLIFY_TOKEN }}" --data-binary "@site.zip" https://api.netlify.com/api/v1/sites > response.json
65-
echo "::set-env name=REPORT_URL::$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")"
66-
echo "::set-env name=JOB_STATUS::$(python -c "print('${{ job.status }}'.lower())")"
81+
echo "::set-output name=REPORT_URL::$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")"
82+
echo "::set-output name=JOB_STATUS::$(python -c "print('${{ job.status }}'.lower())")"
6783
if: always() && job.status == 'failure'
6884

69-
- uses: octokit/request-action@57ec46afcc4c58c813af3afe67e57ced1ea9f165
85+
- uses: octokit/request-action@7e93b91076fad3920c29d44eb2a6311d929db3dd
7086
name: Update status with Github Status API
71-
id: update_status
87+
id: update_status_pr
7288
with:
73-
route: POST /repos/:repository/statuses/:sha
89+
route: POST /repos/{repository}/statuses/{sha}
90+
repository: ${{ github.repository }}
91+
sha: ${{ github.event.pull_request.head.sha }}
92+
state: "${{steps.upload_results.outputs.JOB_STATUS}}"
93+
target_url: "${{steps.upload_results.outputs.REPORT_URL}}"
94+
description: "Link to test report."
95+
context: at-results-${{ matrix.browser }}-${{ matrix.os }}-${{ matrix.java-version }}
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
if: always() && job.status == 'failure' && github.event.pull_request
99+
100+
- uses: octokit/request-action@7e93b91076fad3920c29d44eb2a6311d929db3dd
101+
name: Update status with Github Status API
102+
id: update_status_push
103+
with:
104+
route: POST /repos/{repository}/statuses/{sha}
74105
repository: ${{ github.repository }}
75106
sha: ${{ github.sha }}
76107
state: "${{env.JOB_STATUS}}"
@@ -79,21 +110,22 @@ jobs:
79110
context: at-results-${{ matrix.browser }}-${{ matrix.os }}-${{ matrix.java-version }}
80111
env:
81112
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
if: always() && job.status == 'failure'
113+
if: always() && job.status == 'failure' && github.event.push
83114

84115
release:
85116
needs: [build_and_test]
86-
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/selenium4' || startsWith(github.ref, 'refs/tags/')
117+
if: github.event.push
87118
runs-on: ubuntu-latest
88119
name: Release package
89120
steps:
90121
- uses: actions/checkout@v2
91122
- name: Set up JDK
92-
uses: actions/setup-java@v1.2.0
123+
uses: actions/setup-java@v2.3.0
93124
with:
125+
distribution: zulu
94126
java-version: 8
95127
- name: Release Maven package
96-
uses: samuelmeuli/action-maven-publish@1221d1fa792cab948a772c5e7c1f3abe84aec3bf
128+
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709
97129
with:
98130
gpg_private_key: ${{ secrets.gpg_private_key }}
99131
gpg_passphrase: ${{ secrets.gpg_passphrase }}

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,13 @@
432432
<downloadWebDriver>True</downloadWebDriver>
433433
</properties>
434434
</profile>
435+
<profile>
436+
<id>edgeheadless</id>
437+
<properties>
438+
<browser>edgeheadless</browser>
439+
<downloadWebDriver>True</downloadWebDriver>
440+
</properties>
441+
</profile>
435442
<profile>
436443
<id>deploy</id>
437444
<build>

0 commit comments

Comments
 (0)