-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add daily build to GH actions (#128)
* daily build and refactoring * changed to executable * removed dockfile sed * changed to executable * Sed fix * Fix sed command * Remove `<failOnMissingWebXml>` (see OpenLiberty/guides-common#436) * Update test.yml Co-authored-by: Gilbert Kwan <gkwan@ca.ibm.com> Co-authored-by: Austin Seto <austin.seto@ibm.com>
- Loading branch information
1 parent
9d65309
commit dd215bb
Showing
6 changed files
with
65 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,56 @@ | ||
# This workflow will test the guide application. | ||
# For more information about building and testing Java, | ||
# see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Test application | ||
|
||
on: | ||
pull_request: | ||
branches: [ qa ] | ||
branches: [ master, qa ] | ||
|
||
jobs: | ||
java8build: | ||
needTest: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
canSkip: ${{ steps.checkFiles.outputs.canSkip }} | ||
steps: | ||
- name: Check files in PR | ||
id: checkFiles | ||
run: | | ||
PR_FILES_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{github.event.pull_request.number}}/files" | ||
FILES_CHANGED=$(curl -s -X GET -G $PR_FILES_URL | jq -r '.[] | .filename') | ||
echo $FILES_CHANGED | ||
if [ ${#FILES_CHANGED[@]} == 1 ] && [ ${FILES_CHANGED[0]} == README.adoc ]; then | ||
echo "Test can be skipped because only updated README.adoc" | ||
echo "::set-output name=canSkip::true" | ||
else | ||
echo "Need to run test" | ||
echo "::set-output name=canSkip::false" | ||
fi | ||
java8build: | ||
runs-on: ubuntu-latest | ||
needs: [needTest] | ||
if: "!contains(needs.needTest.outputs.canSkip, 'true')" | ||
defaults: | ||
run: | ||
working-directory: finish | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- run: unset _JAVA_OPTIONS | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- run: unset _JAVA_OPTIONS | ||
|
||
- name: Run tests | ||
run: mvn -q clean install | ||
- name: Post tests | ||
if: always() | ||
run: | | ||
- name: Run tests | ||
run: sudo ../scripts/testApp.sh | ||
- name: Post tests | ||
if: always() | ||
run: | | ||
logsPath=$(sudo find . -name "console.log" | grep inventory); | ||
sudo cat $logsPath | sudo grep Launching | ||
- name: Archive server logs if failed | ||
if: failure() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: server-logs | ||
path: finish/target/liberty/wlp/usr/servers/defaultServer/logs/ | ||
- name: Archive server logs if failed | ||
if: failure() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: server-logs | ||
path: finish/target/liberty/wlp/usr/servers/defaultServer/logs/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
while getopts t:d:b:u: flag; do | ||
case "${flag}" in | ||
t) DATE="${OPTARG}" ;; | ||
d) DRIVER="${OPTARG}" ;; | ||
b) BUILD="${OPTARG}" ;; | ||
u) DOCKER_USERNAME="${OPTARG}" ;; | ||
esac | ||
done | ||
|
||
sed -i "\#<assemblyArtifact>#,\#</assemblyArtifact>#c<install><runtimeUrl>https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/nightly/"$DATE"/"$DRIVER"</runtimeUrl></install>" pom.xml | ||
cat pom.xml | ||
|
||
../scripts/testApp.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
############################################################################## | ||
## | ||
## GH actions CI test script | ||
## | ||
############################################################################## | ||
|
||
mvn -q clean install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters