Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
6640: Run spotless and tests as part of the workflow
  • Loading branch information
thegreystone committed Dec 5, 2019
1 parent db8c7e4 commit 93ab7cd
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/validate.yml
@@ -0,0 +1,40 @@
name: Check formatting and run tests

on: [push, pull_request]

jobs:
linux:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1
- name: Check formatting
run: ./scripts/checkformatting.sh
- name: Run core tests
run: ./scripts/runcoretests.sh
- name: Run application tests
run: ./scripts/runapptests.sh

mac:
runs-on: 'macOS-latest'
steps:
- uses: actions/checkout@v1
- name: Check formatting
run: ./scripts/checkformatting.sh
- name: Run core tests
run: ./scripts/runcoretests.sh
- name: Run application tests
run: ./scripts/runapptests.sh

win:
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@v1
- name: Check formatting
run: .\scripts\checkformatting.bat
shell: cmd
- name: Run core tests
run: .\scripts\runcoretests.bat
shell: cmd
- name: Run application tests
run: .\scripts\runapptests.bat
shell: cmd
11 changes: 11 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,9 @@ build/
target/
bin/

# Ignore settings changes by the IDE
.settings/

# Ignore test recording
application/tests/org.openjdk.jmc.rjmx.services.jfr.test/recording.jfr

Expand All @@ -21,6 +24,11 @@ workspace/
# Ignore UltraEdit .bak files
*.bak

# Normally minor updates to the project files by the IDE
# can be ignored - some minor options are added sometimes
# and the default are usually fine
.project

# Ignore dependency reduced pom
dependency-reduced-pom.xml

Expand All @@ -30,3 +38,6 @@ application/coverage/coverage-report

# Ignore the fetched JS libraries
application/org.openjdk.jmc.flightrecorder.flameview/src/main/resources/jslibs/

# Ignore the output from running the p2 server from the scripts
releng/third-party/nohup.out
2 changes: 1 addition & 1 deletion .jcheck/conf
Expand Up @@ -38,7 +38,7 @@ project=jmc
jbs=jmc

[checks]
error=author,reviewers,merge,message,issues,executable
error=author,reviewers,merge,message,issues

[census]
version=0
Expand Down
15 changes: 15 additions & 0 deletions scripts/checkformatting.bat
@@ -0,0 +1,15 @@
@echo off
echo "======== Building p2 repo ==================="
cd releng\third-party
mvn p2:site
echo "======== Starting p2 repo ==================="
start /B cmd /C "mvn jetty:run"
cd ..\..\core
echo "======== Installing core ===================="
call mvn install
echo "======== Running spotless for core =========="
mvn spotless:check
echo "======== Running spotless for application ==="
cd ..
mvn -Puitests spotless:check
echo "======== Finished ==========================="
18 changes: 18 additions & 0 deletions scripts/checkformatting.sh
@@ -0,0 +1,18 @@
#!/bin/sh -l

set -e
echo "======== Building p2 repo ==================="
cd releng/third-party
sh -c "mvn p2:site"
echo "======== Starting p2 repo ==================="
sh -c "nohup mvn jetty:run &"
cd ../../core
echo "======== Installing core ===================="
sh -c "mvn install"
echo "======== Running spotless for core =========="
sh -c "mvn spotless:check"
echo "======== Running spotless for application ==="
cd ..
sh -c "mvn -Puitests spotless:check"
echo "======== Finished ==========================="

14 changes: 14 additions & 0 deletions scripts/runapptests.bat
@@ -0,0 +1,14 @@
@echo off
REM Seems we need to restart repo
cd releng\third-party
echo "======== Starting p2 repo ==================="
start /B cmd /C "mvn jetty:run"
cd ..\..\core
REM Seems we need to re-install core
echo "======== Installing core ===================="
call mvn install
cd ..
echo "======== Running application tests =========="
mvn verify
echo "======== Finished ==========================="

9 changes: 9 additions & 0 deletions scripts/runapptests.sh
@@ -0,0 +1,9 @@
#!/bin/sh -l

set -e
# Note that core must have been installed, and the p2 repo started
# before running this.
echo "======== Running application tests =========="
sh -c "mvn verify"
echo "======== Finished ==========================="

6 changes: 6 additions & 0 deletions scripts/runcoretests.bat
@@ -0,0 +1,6 @@
@echo off
echo "======== Running core tests ================="
cd core
mvn verify
echo "======== Finished ==========================="

8 changes: 8 additions & 0 deletions scripts/runcoretests.sh
@@ -0,0 +1,8 @@
#!/bin/sh -l

set -e
echo "======== Running core tests ================="
cd core
mvn verify
echo "======== Finished ==========================="

0 comments on commit 93ab7cd

Please sign in to comment.