diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 00000000..308fe392 --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,46 @@ +name: Build and test on PRs + +on: pull_request + +jobs: + test-pr: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Cache Maven dependencies + uses: actions/cache@v2 + env: + cache-name: cache-maven-dep + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Cache node_modules dependencies + uses: actions/cache@v2 + env: + cache-name: cache-node-modules-dep + with: + path: node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-modules- + + - name: Install Maven dependencies (if new ones were added) + run: ./mvnw dependency:go-offline --no-transfer-progress + + - name: Run backend&frontend tests + run: ./mvnw -Pprod clean verify --no-transfer-progress + + - name: Post coverage - Coveralls action + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: target/test-results/lcov.info diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index addc27bf..00000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -os: - - linux -language: java -jdk: - - openjdk11 -sudo: false -cache: - directories: - - node - - node_modules - - $HOME/.m2 -env: - global: - - SPRING_OUTPUT_ANSI_ENABLED=ALWAYS - - SPRING_JPA_SHOW_SQL=false - - JHI_DISABLE_WEBPACK_LOGS=true - - NG_CLI_ANALYTICS="false" -before_install: - - java -version - - node -v - - npm -v -install: - - chmod +x mvnw - - ./mvnw dependency:go-offline --no-transfer-progress - - ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' - - ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' -script: - - ./mvnw clean --no-transfer-progress - - npm test - - ./mvnw test --no-transfer-progress - - npm run coveralls -notifications: - webhooks: - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false diff --git a/package.json b/package.json index 71ee26c2..696c7914 100644 --- a/package.json +++ b/package.json @@ -175,7 +175,7 @@ "start": "npm run webpack:dev", "start-tls": "npm run webpack:dev -- --env.tls", "test": "TZ=UTC npm run lint && TZ=UTC jest --coverage --logHeapUsage -w=2 --config src/test/javascript/jest.conf.js", - "coveralls": "jest --coverage --logHeapUsage -w=2 --config src/test/javascript/jest.conf.js && cat target/test-results/lcov.info | coveralls", + "coveralls": "cat target/test-results/lcov.info | coveralls", "test:watch": "npm test -- --watch", "webpack:dev": "./env-config.sh && npm run webpack-dev-server -- --config webpack/webpack.dev.js --inline --port=9060 --env.stats=minimal", "webpack:dev-verbose": "npm run webpack-dev-server -- --config webpack/webpack.dev.js --inline --port=9060 --profile --progress --env.stats=normal",