From 5e884621b16271ffd72f222f15cd821a419070e3 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 9 Apr 2021 14:44:27 +0200 Subject: [PATCH 1/7] add build docker image to CI --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 777a839a70..22dd62d58c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,30 @@ jobs: - name: Install dependencies run: npm ci - run: npm run madge:circular + check-docker: + name: Docker Build + timeout-minutes: 5 + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.NODE_VERSION }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}- + - name: Install dependencies + run: npm ci + - name: Build docker image + uses: docker/build-push-action@v2 + with: + push: false + tags: user/app:latest check-mongo: strategy: matrix: From d3fc991d395c762c67396c1f37e47506df84c404 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 9 Apr 2021 14:48:11 +0200 Subject: [PATCH 2/7] remove node setup --- .github/workflows/ci.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22dd62d58c..e49c5ac743 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,19 +77,6 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.NODE_VERSION }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Cache Node.js modules - uses: actions/cache@v2 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}- - - name: Install dependencies - run: npm ci - name: Build docker image uses: docker/build-push-action@v2 with: From a7801e1874be206c9f3f7bfd367766546bf483b6 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 9 Apr 2021 14:50:54 +0200 Subject: [PATCH 3/7] removed local dependency to test passing docker build --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 473ca03793..e4b98d3341 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,6 @@ "jsdoc-babel": "0.5.0", "lint-staged": "10.2.3", "madge": "4.0.2", - "mock-mail-adapter": "file:spec/support/MockMailAdapter", "mongodb-runner": "4.8.1", "mongodb-version-list": "1.0.0", "node-fetch": "2.6.1", From 170a275b56150439b18fe8ad55f161e8025d4a56 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 9 Apr 2021 14:53:44 +0200 Subject: [PATCH 4/7] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67cebb83f5..fd2b76864c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -127,6 +127,7 @@ ___ - Added centralized feature deprecation with standardized warning logs (Manuel Trezza) [#7303](https://github.com/parse-community/parse-server/pull/7303) - Use Node.js 15.13.0 in CI (Olle Jonsson) [#7312](https://github.com/parse-community/parse-server/pull/7312) - Fix file upload issue for S3 compatible storage (Linode, DigitalOcean) by avoiding empty tags property when creating a file (Ali Oguzhan Yildiz) [#7300](https://github.com/parse-community/parse-server/pull/7300) +- Add building Docker image as CI check (Manuel Trezza) [#7332](https://github.com/parse-community/parse-server/pull/7332) ___ ## 4.5.0 [Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0) From 0fd6bc4cbe88b432beded7d4e5db389b9b1bf167 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 9 Apr 2021 14:53:55 +0200 Subject: [PATCH 5/7] Revert "removed local dependency to test passing docker build" This reverts commit a7801e1874be206c9f3f7bfd367766546bf483b6. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index e4b98d3341..473ca03793 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "jsdoc-babel": "0.5.0", "lint-staged": "10.2.3", "madge": "4.0.2", + "mock-mail-adapter": "file:spec/support/MockMailAdapter", "mongodb-runner": "4.8.1", "mongodb-version-list": "1.0.0", "node-fetch": "2.6.1", From d7b7c1f6778a2ad06b560a62e5fe4d27444d22bc Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 9 Apr 2021 15:02:44 +0200 Subject: [PATCH 6/7] removed unnecessary docker build options --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e49c5ac743..c4c4c06faf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,9 +79,6 @@ jobs: - uses: actions/checkout@v2 - name: Build docker image uses: docker/build-push-action@v2 - with: - push: false - tags: user/app:latest check-mongo: strategy: matrix: From d82ffd0a8a66088776e456fc4c0a8438ffb69af6 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Fri, 9 Apr 2021 16:28:39 +0200 Subject: [PATCH 7/7] fixed docker build --- .dockerignore | 2 ++ Dockerfile | 4 ++++ package-lock.json | 2 +- package.json | 2 +- .../mock-mail-adapter}/index.js | 0 .../mock-mail-adapter}/package.json | 0 6 files changed, 8 insertions(+), 2 deletions(-) rename spec/{support/MockMailAdapter => dependencies/mock-mail-adapter}/index.js (100%) rename spec/{support/MockMailAdapter => dependencies/mock-mail-adapter}/package.json (100%) diff --git a/.dockerignore b/.dockerignore index c4eac56ab3..da15e92511 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,6 +16,8 @@ lib/ # Tests spec/ +# Keep local dependencies used to CI tests +!spec/dependencies/ # IDEs .idea/ diff --git a/Dockerfile b/Dockerfile index bfc6b98d84..dd500484f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,10 @@ RUN apk update; \ apk add git; WORKDIR /tmp COPY package*.json ./ + +# Copy local dependencies for CI tests +COPY spec/dependencies spec/dependencies + RUN npm ci COPY . . RUN npm run build diff --git a/package-lock.json b/package-lock.json index fab2525abf..0dd5c8acf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9105,7 +9105,7 @@ } }, "mock-mail-adapter": { - "version": "file:spec/support/MockMailAdapter", + "version": "file:spec/dependencies/mock-mail-adapter", "dev": true }, "module-definition": { diff --git a/package.json b/package.json index 473ca03793..a4df201cbc 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "jsdoc-babel": "0.5.0", "lint-staged": "10.2.3", "madge": "4.0.2", - "mock-mail-adapter": "file:spec/support/MockMailAdapter", + "mock-mail-adapter": "file:spec/dependencies/mock-mail-adapter", "mongodb-runner": "4.8.1", "mongodb-version-list": "1.0.0", "node-fetch": "2.6.1", diff --git a/spec/support/MockMailAdapter/index.js b/spec/dependencies/mock-mail-adapter/index.js similarity index 100% rename from spec/support/MockMailAdapter/index.js rename to spec/dependencies/mock-mail-adapter/index.js diff --git a/spec/support/MockMailAdapter/package.json b/spec/dependencies/mock-mail-adapter/package.json similarity index 100% rename from spec/support/MockMailAdapter/package.json rename to spec/dependencies/mock-mail-adapter/package.json