From 1426456c28ddd781624a2c244610c6f72aa1c466 Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 18:00:15 +0100 Subject: [PATCH 01/10] test trigger --- .github/workflows/pr-build.yml | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/pr-build.yml diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 00000000..0fad9e8b --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,37 @@ +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: Install Maven dependencies (if new ones were added) + run: ./mvnw dependency:go-offline --no-transfer-progress + - name: Install node and npm dependencies + run: ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' + - name: Install node modules + run: ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' + - name: Maven clean + run: ./mvnw clean + - name: Run frontend tests + run: npm test + - name: Run backend tests + run: ./mvnw test --no-transfer-progress + - name: Run coveralls + run: npm run coveralls From 7b7b11f9b27d2de15e15d55c8f291a7f1907c68f Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 18:18:02 +0100 Subject: [PATCH 02/10] testing-verify-coveralls --- .github/workflows/pr-build.yml | 32 ++++++++++++++++++-------------- package.json | 1 + 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 0fad9e8b..b55abeaf 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -21,17 +21,21 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - name: Install Maven dependencies (if new ones were added) - run: ./mvnw dependency:go-offline --no-transfer-progress - - name: Install node and npm dependencies - run: ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' - - name: Install node modules - run: ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' - - name: Maven clean - run: ./mvnw clean - - name: Run frontend tests - run: npm test - - name: Run backend tests - run: ./mvnw test --no-transfer-progress - - name: Run coveralls - run: npm run coveralls + # - 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: Install node and npm dependencies + # run: ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' + # - name: Install node modules + # run: ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' + # - name: Maven clean + # run: ./mvnw clean + # - name: Run frontend tests + # run: npm test + # - name: Run backend tests + # run: ./mvnw test --no-transfer-progress + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 71ee26c2..c99b04bc 100644 --- a/package.json +++ b/package.json @@ -176,6 +176,7 @@ "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-copy": "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", From 3b2de6a93cf536022ae664f46bb10d5c44b3e552 Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 18:35:20 +0100 Subject: [PATCH 03/10] adding copy coverage result step --- .github/workflows/pr-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index b55abeaf..a2d3e7bd 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -35,6 +35,8 @@ jobs: # run: npm test # - name: Run backend tests # run: ./mvnw test --no-transfer-progress + - name: Run coveralls + run: npm run coveralls-copy - name: Coveralls uses: coverallsapp/github-action@master with: From 702f8f32cd39f0c84b1f36722bbad2e65d1678c2 Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 18:55:15 +0100 Subject: [PATCH 04/10] fix path to lcov --- .github/workflows/pr-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index a2d3e7bd..c438a050 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -36,8 +36,9 @@ jobs: # - name: Run backend tests # run: ./mvnw test --no-transfer-progress - name: Run coveralls - run: npm run coveralls-copy + run: cat target/test-results/lcov.info - name: Coveralls uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: target/test-results/lcov.info From 849b71bcd2ce0c27809cfa97bb068c3c8a3d969b Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 19:10:57 +0100 Subject: [PATCH 05/10] npm test separate --- .github/workflows/pr-build.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index c438a050..e3d0b5a3 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -6,6 +6,8 @@ on: jobs: test-pr: runs-on: ubuntu-18.04 + env: + SPRING_OUTPUT_ANSI_ENABLED: ALWAYS steps: - uses: actions/checkout@v2 - name: Set up JDK 11 @@ -23,18 +25,18 @@ jobs: ${{ runner.os }}-maven- # - 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: Install node and npm dependencies - # run: ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' - # - name: Install node modules - # run: ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' + # - name: Run backend&frontend tests + # run: ./mvnw -Pprod clean verify --no-transfer-progress + - name: Install node and npm dependencies + run: ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' + - name: Install node modules + run: ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' # - name: Maven clean # run: ./mvnw clean - # - name: Run frontend tests - # run: npm test - # - name: Run backend tests - # run: ./mvnw test --no-transfer-progress + - name: Run frontend tests + run: npm test + - name: Run backend tests + run: ./mvnw test --no-transfer-progress - name: Run coveralls run: cat target/test-results/lcov.info - name: Coveralls From 1839779613701f9aef62cd7bee68d23cf9ec9859 Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 19:25:58 +0100 Subject: [PATCH 06/10] test verify --- .github/workflows/pr-build.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index e3d0b5a3..485e647e 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -23,20 +23,20 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - # - 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: Install node and npm dependencies - run: ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' - - name: Install node modules - run: ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' + - 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: Install node and npm dependencies + # run: ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' + # - name: Install node modules + # run: ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' # - name: Maven clean # run: ./mvnw clean - - name: Run frontend tests - run: npm test - - name: Run backend tests - run: ./mvnw test --no-transfer-progress + # - name: Run frontend tests + # run: npm test + # - name: Run backend tests + # run: ./mvnw test --no-transfer-progress - name: Run coveralls run: cat target/test-results/lcov.info - name: Coveralls From 3bd066a31943b834411ffaf6c9cf1e5b80f4c8c5 Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 19:28:45 +0100 Subject: [PATCH 07/10] caching node modules --- .github/workflows/pr-build.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 485e647e..cb73e5a2 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -23,20 +23,19 @@ jobs: 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-maven-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: Install node and npm dependencies - # run: ./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-npm@'install node and npm' - # - name: Install node modules - # run: ./mvnw com.github.eirslett:frontend-maven-plugin:npm@'npm install' - # - name: Maven clean - # run: ./mvnw clean - # - name: Run frontend tests - # run: npm test - # - name: Run backend tests - # run: ./mvnw test --no-transfer-progress - name: Run coveralls run: cat target/test-results/lcov.info - name: Coveralls From 5290cc9c16ef96fcd9af60b04b7874db74f4bd50 Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 19:35:51 +0100 Subject: [PATCH 08/10] caching node executable --- .github/workflows/pr-build.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index cb73e5a2..71e9786f 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -1,19 +1,18 @@ name: Build and test on PRs -on: - pull_request +on: pull_request jobs: test-pr: runs-on: ubuntu-18.04 - env: - SPRING_OUTPUT_ANSI_ENABLED: ALWAYS 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: @@ -23,22 +22,37 @@ jobs: 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-maven-dep + 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: Cache node executable + uses: actions/cache@v2 + env: + cache-name: cache-node-dep + with: + path: node + key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-node- + - 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: Run coveralls run: cat target/test-results/lcov.info - name: Coveralls + uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} From e403ec2aadd525e271e2fd8bfcdd6e9499500958 Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 19:37:51 +0100 Subject: [PATCH 09/10] coveralls name change --- .github/workflows/pr-build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 71e9786f..a1c31901 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -49,10 +49,7 @@ jobs: - name: Run backend&frontend tests run: ./mvnw -Pprod clean verify --no-transfer-progress - - name: Run coveralls - run: cat target/test-results/lcov.info - - name: Coveralls - + - name: Post coverage - Coveralls action uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} From 441fafa21db93ce770d25dcae51d17166d3aa949 Mon Sep 17 00:00:00 2001 From: Kristof Kaczmarczyk Date: Thu, 21 Jan 2021 19:50:20 +0100 Subject: [PATCH 10/10] final --- .github/workflows/pr-build.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index a1c31901..308fe392 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -33,16 +33,6 @@ jobs: restore-keys: | ${{ runner.os }}-node-modules- - - name: Cache node executable - uses: actions/cache@v2 - env: - cache-name: cache-node-dep - with: - path: node - key: ${{ runner.os }}-node-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Install Maven dependencies (if new ones were added) run: ./mvnw dependency:go-offline --no-transfer-progress