From fc7a74dfc5fff91e6e8963001df110f73aa6eab4 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:15:26 +0300 Subject: [PATCH 01/16] =?UTF-8?q?Lis=C3=A4=C3=A4=20build=5Fkoski.yml=20-ti?= =?UTF-8?q?edosto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build_koski.yml diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml new file mode 100644 index 0000000000..0becc326a5 --- /dev/null +++ b/.github/workflows/build_koski.yml @@ -0,0 +1,49 @@ +name: Build Koski & Valpas +on: + pull_request: + +jobs: + build-koski-frontend: + runs-on: "ubuntu-20.04" + strategy: + matrix: + node-version: [ 16.19.0 ] + steps: + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: ./web/package-lock.json + - name: "Install npm dependencies" + working-directory: "web" + run: npm ci + build-valpas-frontend: + runs-on: "ubuntu-20.04" + strategy: + matrix: + node-version: [ 16.19.0 ] + steps: + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + cache-dependency-path: ./valpas-web/package-lock.json + - name: "Install npm dependencies" + working-directory: valpas-web + run: npm ci + build-koski-backend: + runs-on: "ubuntu-20.04" + strategy: + matrix: + java-version: [ 11 ] + java-arch: [ x64 ] + java-dist: [ zulu ] + steps: + - name: Set up Java ${{ matrix.java-version }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java-version }} + architecture: ${{ matrix.java-arch }} + distribution: ${{ matrix.java-dist }} From 9eabe44e2d8ee5e2c3ec0653faa8db44da838d67 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:17:06 +0300 Subject: [PATCH 02/16] Testaa korjausta cache-dependency-path:iin --- .github/workflows/build_koski.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 0becc326a5..7a75d2cc67 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -14,7 +14,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: ./web/package-lock.json + cache-dependency-path: web/package-lock.json - name: "Install npm dependencies" working-directory: "web" run: npm ci @@ -29,7 +29,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: ./valpas-web/package-lock.json + cache-dependency-path: valpas-web/package-lock.json - name: "Install npm dependencies" working-directory: valpas-web run: npm ci From 15bc6695eaba3a2bc7f8245eeb4d3c879c2fbadd Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:19:09 +0300 Subject: [PATCH 03/16] =?UTF-8?q?Lis=C3=A4=C3=A4=20puuttuva=20checkout-act?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 7a75d2cc67..3f52e89e49 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -9,6 +9,7 @@ jobs: matrix: node-version: [ 16.19.0 ] steps: + - uses: actions/checkout@v3 - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: @@ -24,6 +25,7 @@ jobs: matrix: node-version: [ 16.19.0 ] steps: + - uses: actions/checkout@v3 - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: @@ -41,6 +43,7 @@ jobs: java-arch: [ x64 ] java-dist: [ zulu ] steps: + - uses: actions/checkout@v3 - name: Set up Java ${{ matrix.java-version }} uses: actions/setup-java@v3 with: From 1d1cd243bac0b9973fefec5f07bff77b90a94d2b Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:29:15 +0300 Subject: [PATCH 04/16] =?UTF-8?q?Lis=C3=A4=C3=A4=20buildin=20cachetus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 3f52e89e49..bdb2d21abb 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -19,6 +19,16 @@ jobs: - name: "Install npm dependencies" working-directory: "web" run: npm ci + - name: "Check for build cache" + uses: actions/cache@v3 + id: koski-frontend-build-cache + with: + path: target/webapp/koski + key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('web/app/**') }} + - name: "Build app" + if: steps.koski-frontend-build-cache.outputs.cache-hit != 'true' + working-directory: "web" + run: npm run build:prod build-valpas-frontend: runs-on: "ubuntu-20.04" strategy: @@ -50,3 +60,5 @@ jobs: java-version: ${{ matrix.java-version }} architecture: ${{ matrix.java-arch }} distribution: ${{ matrix.java-dist }} + - name: Build + run: sbt -v From 0f221b287f7106b815643e865a4f184a289aa9b4 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:34:17 +0300 Subject: [PATCH 05/16] Add Valpas cache check --- .github/workflows/build_koski.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index bdb2d21abb..db3dc6d6b2 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -25,7 +25,7 @@ jobs: with: path: target/webapp/koski key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('web/app/**') }} - - name: "Build app" + - name: "Build Koski web" if: steps.koski-frontend-build-cache.outputs.cache-hit != 'true' working-directory: "web" run: npm run build:prod @@ -45,7 +45,18 @@ jobs: - name: "Install npm dependencies" working-directory: valpas-web run: npm ci + - name: "Build Valpas web" + uses: actions/cache@v3 + id: valpas-frontend-build-cache + with: + path: target/webapp/valpas + key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/src/**') }} + - name: "Build Koski web" + if: steps.valpas-frontend-build-cache.outputs.cache-hit != 'true' + working-directory: "web" + run: npm run build:prod build-koski-backend: + needs: [build-koski-frontend, build-valpas-frontend] runs-on: "ubuntu-20.04" strategy: matrix: From ac6555b78ed5ea2db51c27e0af45544fb00ceccb Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:36:32 +0300 Subject: [PATCH 06/16] =?UTF-8?q?Korjaa=20v=C3=A4=C3=A4r=C3=A4=20stepin=20?= =?UTF-8?q?nimi=20ja=20working=20dir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index db3dc6d6b2..b562257dca 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -19,7 +19,7 @@ jobs: - name: "Install npm dependencies" working-directory: "web" run: npm ci - - name: "Check for build cache" + - name: "Check Koski build cache" uses: actions/cache@v3 id: koski-frontend-build-cache with: @@ -45,15 +45,15 @@ jobs: - name: "Install npm dependencies" working-directory: valpas-web run: npm ci - - name: "Build Valpas web" + - name: "Check Valpas build cache" uses: actions/cache@v3 id: valpas-frontend-build-cache with: path: target/webapp/valpas key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/src/**') }} - - name: "Build Koski web" + - name: "Build Valpas web" if: steps.valpas-frontend-build-cache.outputs.cache-hit != 'true' - working-directory: "web" + working-directory: "valpas-web" run: npm run build:prod build-koski-backend: needs: [build-koski-frontend, build-valpas-frontend] @@ -71,5 +71,5 @@ jobs: java-version: ${{ matrix.java-version }} architecture: ${{ matrix.java-arch }} distribution: ${{ matrix.java-dist }} - - name: Build - run: sbt -v + - name: Check Maven version + run: mvn --version From fc5773d792984c16f34b0f8706e066a6906d53e2 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:38:17 +0300 Subject: [PATCH 07/16] =?UTF-8?q?Debug=20print:=20target/webapp=20-kansion?= =?UTF-8?q?=20sis=C3=A4lt=C3=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index b562257dca..8d7885c4b7 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -73,3 +73,5 @@ jobs: distribution: ${{ matrix.java-dist }} - name: Check Maven version run: mvn --version + - name: Check target folder contents + run: ls --lra target/webapp From 2bd7bca9bc1f82d307c1a04d5d295ebe400a1ef4 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:39:50 +0300 Subject: [PATCH 08/16] =?UTF-8?q?Debug=20print:=20target/webapp=20-kansion?= =?UTF-8?q?=20sis=C3=A4lt=C3=B6=20(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 8d7885c4b7..4a97386863 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -3,11 +3,11 @@ on: pull_request: jobs: + strategy: + matrix: + node-version: [ 16.19.0 ] build-koski-frontend: runs-on: "ubuntu-20.04" - strategy: - matrix: - node-version: [ 16.19.0 ] steps: - uses: actions/checkout@v3 - name: Setup Node.js ${{ matrix.node-version }} @@ -74,4 +74,4 @@ jobs: - name: Check Maven version run: mvn --version - name: Check target folder contents - run: ls --lra target/webapp + run: ls -lra target/webapp From 5eeaa684a5a754b7a832f0d0fbc9d32b42d68294 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:40:37 +0300 Subject: [PATCH 09/16] Korjaa typo --- .github/workflows/build_koski.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 4a97386863..21b65f1629 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -3,11 +3,11 @@ on: pull_request: jobs: - strategy: - matrix: - node-version: [ 16.19.0 ] build-koski-frontend: runs-on: "ubuntu-20.04" + strategy: + matrix: + node-version: [ 16.19.0 ] steps: - uses: actions/checkout@v3 - name: Setup Node.js ${{ matrix.node-version }} From 5a6378d4a4431afd21ef84ab1e63de58968d0eb8 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:43:29 +0300 Subject: [PATCH 10/16] Hae Koski ja Valpas buildit cachesta back-endin buildausta varten --- .github/workflows/build_koski.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 21b65f1629..eaeb6a4762 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -73,5 +73,17 @@ jobs: distribution: ${{ matrix.java-dist }} - name: Check Maven version run: mvn --version + - name: "Get Koski production build" + uses: actions/cache@v3 + id: koski-frontend-build-cache + with: + path: target/webapp/koski + key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('web/app/**') }} + - name: "Get Valpas production build" + uses: actions/cache@v3 + id: valpas-frontend-build-cache + with: + path: target/webapp/valpas + key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/app/**') }} - name: Check target folder contents run: ls -lra target/webapp From f374892d6f5a134d34cd17912470d63268f36511 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:45:13 +0300 Subject: [PATCH 11/16] =?UTF-8?q?Lis=C3=A4=C3=A4=20puuttuva=20Node-versio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index eaeb6a4762..6c86ebf8db 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -60,6 +60,7 @@ jobs: runs-on: "ubuntu-20.04" strategy: matrix: + node-version: [ 16.19.0 ] java-version: [ 11 ] java-arch: [ x64 ] java-dist: [ zulu ] From bad1749878816b87c0adbd5951c9e5b3d6e7141a Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:48:01 +0300 Subject: [PATCH 12/16] =?UTF-8?q?=C3=84l=C3=A4=20asenna=20Nodea=20ja=20dep?= =?UTF-8?q?endencyj=C3=A4=20turhaan,=20jos=20buildi=20on=20ajantasainen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 6c86ebf8db..9437927712 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -10,21 +10,23 @@ jobs: node-version: [ 16.19.0 ] steps: - uses: actions/checkout@v3 + - name: "Check Koski build cache" + uses: actions/cache@v3 + id: koski-frontend-build-cache + with: + path: target/webapp/koski + key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('web/app/**') }} - name: Setup Node.js ${{ matrix.node-version }} + if: steps.koski-frontend-build-cache.outputs.cache-hit != 'true' uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: web/package-lock.json - name: "Install npm dependencies" + if: steps.koski-frontend-build-cache.outputs.cache-hit != 'true' working-directory: "web" run: npm ci - - name: "Check Koski build cache" - uses: actions/cache@v3 - id: koski-frontend-build-cache - with: - path: target/webapp/koski - key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('web/app/**') }} - name: "Build Koski web" if: steps.koski-frontend-build-cache.outputs.cache-hit != 'true' working-directory: "web" @@ -36,21 +38,23 @@ jobs: node-version: [ 16.19.0 ] steps: - uses: actions/checkout@v3 + - name: "Check Valpas build cache" + uses: actions/cache@v3 + id: valpas-frontend-build-cache + with: + path: target/webapp/valpas + key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/src/**') }} - name: Setup Node.js ${{ matrix.node-version }} + if: steps.valpas-frontend-build-cache.outputs.cache-hit != 'true' uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: valpas-web/package-lock.json - name: "Install npm dependencies" + if: steps.valpas-frontend-build-cache.outputs.cache-hit != 'true' working-directory: valpas-web run: npm ci - - name: "Check Valpas build cache" - uses: actions/cache@v3 - id: valpas-frontend-build-cache - with: - path: target/webapp/valpas - key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/src/**') }} - name: "Build Valpas web" if: steps.valpas-frontend-build-cache.outputs.cache-hit != 'true' working-directory: "valpas-web" From 1caee89491d1fc030c2f9213bd661973b4d22720 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:49:35 +0300 Subject: [PATCH 13/16] =?UTF-8?q?Korjaa=20v=C3=A4=C3=A4r=C3=A4=20hashFiles?= =?UTF-8?q?=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_koski.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 9437927712..b537910f33 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -89,6 +89,6 @@ jobs: id: valpas-frontend-build-cache with: path: target/webapp/valpas - key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/app/**') }} + key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/src/**') }} - name: Check target folder contents run: ls -lra target/webapp From ffdf7e5516f3a2bd6413628d7e533b95021bcad5 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 14:05:56 +0300 Subject: [PATCH 14/16] Aja mvn verify buildvaiheessa --- .github/workflows/build_koski.yml | 4 +-- pom.xml | 60 ------------------------------- 2 files changed, 2 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index b537910f33..7c689ba0c4 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -90,5 +90,5 @@ jobs: with: path: target/webapp/valpas key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/src/**') }} - - name: Check target folder contents - run: ls -lra target/webapp + - name: Build Koski app + run: mvn verify -DskipTests=true diff --git a/pom.xml b/pom.xml index 276d85842a..7691df1792 100644 --- a/pom.xml +++ b/pom.xml @@ -387,16 +387,6 @@ frontend-maven-plugin 1.12.0 - - koski - install node and npm - - install-node-and-npm - - - web - v16.19.0 - - npm version @@ -407,56 +397,6 @@ --version - - koski - npm ci - - npm - - - web - ci - - - - koski - npm build - - npm - - - web - run build:prod - - - - valpas - install node and npm - - install-node-and-npm - - - valpas-web - v16.19.0 - - - - valpas - npm ci - - npm - - - valpas-web - ci - - - - valpas - npm build - - npm - - - valpas-web - run build:prod - - From b74b783d780ad5600a0644cdf2126387b2e7f987 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 14:07:44 +0300 Subject: [PATCH 15/16] Tarkista buildversion.txt --- .github/workflows/build_koski.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_koski.yml b/.github/workflows/build_koski.yml index 7c689ba0c4..4a337dea12 100644 --- a/.github/workflows/build_koski.yml +++ b/.github/workflows/build_koski.yml @@ -92,3 +92,5 @@ jobs: key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('valpas-web/src/**') }} - name: Build Koski app run: mvn verify -DskipTests=true + - name: Check buildversion.txt + run: cat target/webapp/buildversion.txt From 183fd7e22744627888ae29e59e11e0c2c2f2ead5 Mon Sep 17 00:00:00 2001 From: Aleksi Huotala <7612995+alehuo@users.noreply.github.com> Date: Fri, 28 Jul 2023 14:10:05 +0300 Subject: [PATCH 16/16] Poista npm-version tarkistus --- pom.xml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pom.xml b/pom.xml index 7691df1792..61430fbe8a 100644 --- a/pom.xml +++ b/pom.xml @@ -386,18 +386,6 @@ com.github.eirslett frontend-maven-plugin 1.12.0 - - - npm version - - npm - - - web - --version - - - org.apache.maven.plugins