From cde28f4074dc30ee3a1e65aeec58e00baf1ae958 Mon Sep 17 00:00:00 2001 From: tooomm Date: Fri, 26 Mar 2021 22:59:47 +0100 Subject: [PATCH 01/33] expose node version --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 63bf27de..5cd1f86a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,8 +57,10 @@ jobs: - name: Run run: docker run -dp 1337:1337 dr4ft-app - - name: Show info + - name: Show container information run: | + docker run -it --rm node:alpine node + echo docker --version echo docker ps -a From 1881aae3fd748398a15de821e42d2e3600ddf870 Mon Sep 17 00:00:00 2001 From: tooomm Date: Fri, 26 Mar 2021 23:03:39 +0100 Subject: [PATCH 02/33] another try --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5cd1f86a..2366c975 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,7 +59,7 @@ jobs: - name: Show container information run: | - docker run -it --rm node:alpine node + docker run -it --rm node /bin/bash -c 'node --version' echo docker --version echo From c725df7c36dd2bb7c26b095ea7dfa9270e2d5846 Mon Sep 17 00:00:00 2001 From: tooomm Date: Fri, 26 Mar 2021 23:16:44 +0100 Subject: [PATCH 03/33] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2366c975..9e178c4f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,7 +59,7 @@ jobs: - name: Show container information run: | - docker run -it --rm node /bin/bash -c 'node --version' + docker run node:lts-alpine node --version echo docker --version echo From 61e7855f5e5d171cedd97b8b1c11f0cd4f73124a Mon Sep 17 00:00:00 2001 From: tooomm Date: Fri, 26 Mar 2021 23:25:24 +0100 Subject: [PATCH 04/33] reorder --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e178c4f..8ffdd816 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,14 +59,14 @@ jobs: - name: Show container information run: | - docker run node:lts-alpine node --version - echo docker --version echo docker ps -a echo docker images - + echo + echo "Node version" + docker run node:lts-alpine node --version lint: name: Run ESLint From 8db143604f2efa6c07f8da39314055747d469bd6 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 14:33:23 +0200 Subject: [PATCH 05/33] add node 16 --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8ffdd816..081753ab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,8 +19,9 @@ jobs: strategy: matrix: node_version: - - 12 - - 14 + - '12.x' + - '14.x' + - '16.x' runs-on: ubuntu-latest From c220b6db1a0a7e1dcb23297206ee459b87478d02 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 14:37:50 +0200 Subject: [PATCH 06/33] remove quotes --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 081753ab..86857397 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,9 +19,9 @@ jobs: strategy: matrix: node_version: - - '12.x' - - '14.x' - - '16.x' + - 12.x + - 14.x + - 16.x runs-on: ubuntu-latest From 6c063aebc3115787140b8b961833a1c92a0707e1 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 14:45:55 +0200 Subject: [PATCH 07/33] postpone v16 to official release as current 2020-04-20 --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86857397..a8f5d923 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,6 @@ jobs: node_version: - 12.x - 14.x - - 16.x runs-on: ubuntu-latest From 05fceb9c33cc6136ca9d66f86c2c24e937234e00 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 20:04:02 +0200 Subject: [PATCH 08/33] curl --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a8f5d923..fbf017de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,9 +55,9 @@ jobs: run: docker build --tag dr4ft-app . - name: Run - run: docker run -dp 1337:1337 dr4ft-app + run: docker run -d --name dr4ft -p 1337:1337 dr4ft-app - - name: Show container information + - name: Show information run: | docker --version echo @@ -67,6 +67,9 @@ jobs: echo echo "Node version" docker run node:lts-alpine node --version + echo + curl https://localhost:1337 + lint: name: Run ESLint From 71939859e0512f8b6800416fc7fd2e56926e04fd Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 20:08:21 +0200 Subject: [PATCH 09/33] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fbf017de..32887a5d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,7 +68,7 @@ jobs: echo "Node version" docker run node:lts-alpine node --version echo - curl https://localhost:1337 + curl http://localhost:1337 lint: From 973727e6b4581447e466e1b98c9d0c3090c16136 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 20:12:22 +0200 Subject: [PATCH 10/33] Update tests.yml --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32887a5d..c9e89a67 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,7 +68,8 @@ jobs: echo "Node version" docker run node:lts-alpine node --version echo - curl http://localhost:1337 + echo "Accessing localhost:1337" + wget http://localhost:1337 lint: From 839fbf9e45c602c0949d85e5509ade0e60eb6a1c Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 20:18:07 +0200 Subject: [PATCH 11/33] Update tests.yml --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c9e89a67..3ae2de2a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,11 +51,14 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Build + - name: Build Docker container run: docker build --tag dr4ft-app . - - name: Run + - name: Run Docker container run: docker run -d --name dr4ft -p 1337:1337 dr4ft-app + + - name: Access Docker container + run: wget https://localhost:1337 - name: Show information run: | @@ -67,9 +70,6 @@ jobs: echo echo "Node version" docker run node:lts-alpine node --version - echo - echo "Accessing localhost:1337" - wget http://localhost:1337 lint: From 7c5372265a6ae6aa203bd5956a5c2467d39cb557 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 20:21:19 +0200 Subject: [PATCH 12/33] Update tests.yml --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3ae2de2a..8be1c1ac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,7 +41,7 @@ jobs: docker: - name: Test docker image + name: Test Docker image runs-on: ubuntu-latest @@ -58,7 +58,7 @@ jobs: run: docker run -d --name dr4ft -p 1337:1337 dr4ft-app - name: Access Docker container - run: wget https://localhost:1337 + run: wget http://localhost:1337 - name: Show information run: | From cf0ee7d56178eaa534d3738e7621dd87d8ee4bb0 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 20:27:42 +0200 Subject: [PATCH 13/33] comment --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8be1c1ac..024ea355 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,6 +57,7 @@ jobs: - name: Run Docker container run: docker run -d --name dr4ft -p 1337:1337 dr4ft-app + # TODO: This needs probably some tweaking - name: Access Docker container run: wget http://localhost:1337 From 186016272d6cea1b682b7768e55203f3a6502d1c Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 12 Apr 2021 20:32:29 +0200 Subject: [PATCH 14/33] Update tests.yml --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 024ea355..2742523e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,13 +51,13 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Build Docker container + - name: Build container from Dockerfile run: docker build --tag dr4ft-app . - name: Run Docker container run: docker run -d --name dr4ft -p 1337:1337 dr4ft-app - # TODO: This needs probably some tweaking + # TODO: This needs probably some tweaking or can be tested further - name: Access Docker container run: wget http://localhost:1337 From e7ec4002a1de7a61cd757d2456a37fa60d5ac438 Mon Sep 17 00:00:00 2001 From: tooomm Date: Wed, 14 Apr 2021 14:34:05 +0200 Subject: [PATCH 15/33] names --- .github/workflows/tests.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2742523e..1ede9e86 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,8 +13,8 @@ on: - '**.md' jobs: - test: - name: Run tests + node: + name: Node ${{ matrix.node_version }} strategy: matrix: @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@v2 - name: Setup - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: ${{matrix.node_version}} @@ -41,7 +41,7 @@ jobs: docker: - name: Test Docker image + name: Docker image (lts-alpine) runs-on: ubuntu-latest @@ -69,12 +69,12 @@ jobs: echo docker images echo - echo "Node version" + echo "Node version (dr4ft container)" docker run node:lts-alpine node --version lint: - name: Run ESLint + name: ESLint runs-on: ubuntu-latest @@ -82,10 +82,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Setup - uses: actions/setup-node@v1 - with: - node-version: 12 + #Don't manually pin Node version and use provided one in ubuntu package + #- name: Setup + # uses: actions/setup-node@v2 + # with: + # node-version: 12 - name: Install run: npm install --ignore-scripts From c314b94467553984f20c8ada92e2ebb9864df394 Mon Sep 17 00:00:00 2001 From: tooomm Date: Wed, 14 Apr 2021 14:50:12 +0200 Subject: [PATCH 16/33] Update tests.yml --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ede9e86..a52b511b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -82,7 +82,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - #Don't manually pin Node version and use provided one in ubuntu package + #Use default Node version from GitHub Actions VM (Ubuntu) #- name: Setup # uses: actions/setup-node@v2 # with: @@ -92,4 +92,7 @@ jobs: run: npm install --ignore-scripts - name: Run ESLint - run: npm run lint + run: | + node --version + echo + npm run lint From 4c3286fb641698bb82ce4bc6bd5e562766fa002c Mon Sep 17 00:00:00 2001 From: tooomm Date: Wed, 14 Apr 2021 14:54:10 +0200 Subject: [PATCH 17/33] comment docker checks out --- .github/dependabot.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 55545ddc..8db7cbee 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,12 +14,13 @@ updates: # Limit the amout of open PR's (default = 5, disabled = 0, security updates are not impacted) open-pull-requests-limit: 5 - # Enable version updates for Docker - - package-ecosystem: "docker" - # Look for a `Dockerfile` in the `root` directory - directory: "/" - # Check for updates once a week - schedule: - interval: "weekly" - # Limit the amout of open PR's (default = 5, disabled = 0, security updates are not impacted) - open-pull-requests-limit: 1 +#Since we use the lts-alpine image in the Dockerfile this is currently not needed +# # Enable version updates for Docker +# - package-ecosystem: "docker" +# # Look for a `Dockerfile` in the `root` directory +# directory: "/" +# # Check for updates once a week +# schedule: +# interval: "weekly" +# # Limit the amout of open PR's (default = 5, disabled = 0, security updates are not impacted) +# open-pull-requests-limit: 1 From 2575a6626664c3326c3b04b4f91786a8d9a8c088 Mon Sep 17 00:00:00 2001 From: tooomm Date: Tue, 20 Apr 2021 19:34:56 +0200 Subject: [PATCH 18/33] add node 16 to test matrix --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a52b511b..b873a842 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,6 +21,7 @@ jobs: node_version: - 12.x - 14.x + - 16.x runs-on: ubuntu-latest From 539fb48ab874a36d4b8bf2dc5de7ef3078bd245f Mon Sep 17 00:00:00 2001 From: tooomm Date: Wed, 30 Jun 2021 16:14:03 +0200 Subject: [PATCH 19/33] add LTS alias requires setup-node action v2.2.0 --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b873a842..b33e83fa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,6 +19,7 @@ jobs: strategy: matrix: node_version: + - lts/* - 12.x - 14.x - 16.x From d7ca092bacea7ec4098d8aa16d754e705157c884 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 5 Jul 2021 15:02:55 +0200 Subject: [PATCH 20/33] add npm cache --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b33e83fa..5188613c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,6 +34,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{matrix.node_version}} + cache: npm - name: Install run: npm install From ac5b4812798fb5491558bff7914c2c66ddae6363 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 5 Jul 2021 15:31:14 +0200 Subject: [PATCH 21/33] Test against current node version --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5188613c..ee2ca868 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,12 +20,15 @@ jobs: matrix: node_version: - lts/* + - current/* - 12.x - 14.x - - 16.x runs-on: ubuntu-latest - + + #Allow failues for most recent Node release + continue-on-error: ${{matrix.node_version == 'current/*'}} + steps: - name: Checkout uses: actions/checkout@v2 From fcef544c896f47c69b2aa972c8ee4ba730c58b29 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 19 Jul 2021 12:07:33 +0200 Subject: [PATCH 22/33] disable fail-fast --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee2ca868..858bbec4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,6 +24,7 @@ jobs: - 12.x - 14.x + fail-fast: false runs-on: ubuntu-latest #Allow failues for most recent Node release From 63eee842a63907549a93d9d31149cd4e7d12559b Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 24 Oct 2021 18:37:27 +0200 Subject: [PATCH 23/33] Update tests.yml --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 858bbec4..bf0bcc22 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,10 +19,9 @@ jobs: strategy: matrix: node_version: + - 12.x - lts/* - current/* - - 12.x - - 14.x fail-fast: false runs-on: ubuntu-latest From 1cdbe4a9b5f1962b6d77a44984cbecf8d758a220 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 24 Oct 2021 18:44:35 +0200 Subject: [PATCH 24/33] correct fail-fast --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf0bcc22..89a6e0c0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,13 +17,13 @@ jobs: name: Node ${{ matrix.node_version }} strategy: + fail-fast: false matrix: node_version: - 12.x - lts/* - current/* - fail-fast: false runs-on: ubuntu-latest #Allow failues for most recent Node release From 368140878b1893288487405a4ca46d03ef62104d Mon Sep 17 00:00:00 2001 From: tooomm Date: Sat, 27 Nov 2021 11:12:38 +0100 Subject: [PATCH 25/33] npm ci --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 89a6e0c0..d3661c8f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,10 +40,10 @@ jobs: cache: npm - name: Install - run: npm install + run: npm clean-install - name: Test - run: npm test + run: npm run test docker: @@ -95,7 +95,7 @@ jobs: # node-version: 12 - name: Install - run: npm install --ignore-scripts + run: npm clean-install --ignore-scripts - name: Run ESLint run: | From f768434dcd12dced599959df0d790f9858fd0323 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 27 Feb 2022 22:22:26 +0100 Subject: [PATCH 26/33] fix node --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d3661c8f..57a8b867 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: node_version: - - 12.x + - 12 - lts/* - current/* From bc61beeca8c95658cb284817159f66c424d72e80 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 16 May 2022 16:05:00 +0200 Subject: [PATCH 27/33] some version bumps and adjust alias --- .github/workflows/tests.yml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 57a8b867..880ebd67 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,21 +22,21 @@ jobs: node_version: - 12 - lts/* - - current/* + - current runs-on: ubuntu-latest - #Allow failues for most recent Node release - continue-on-error: ${{matrix.node_version == 'current/*'}} + # Allow failues for most recent Node release + continue-on-error: ${{ matrix.node_version == 'current' }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: ${{matrix.node_version}} + node-version: ${{ matrix.node_version }} cache: npm - name: Install @@ -47,7 +47,7 @@ jobs: docker: - name: Docker image (lts-alpine) + name: Docker (lts-alpine) runs-on: ubuntu-latest @@ -55,13 +55,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Build container from Dockerfile + - name: Build image from Dockerfile run: docker build --tag dr4ft-app . - - name: Run Docker container - run: docker run -d --name dr4ft -p 1337:1337 dr4ft-app + - name: Run container from image + run: docker run -d -p 1337:1337 --name dr4ft dr4ft-app # TODO: This needs probably some tweaking or can be tested further - name: Access Docker container @@ -71,10 +71,10 @@ jobs: run: | docker --version echo - docker ps -a - echo docker images echo + docker ps -a + echo echo "Node version (dr4ft container)" docker run node:lts-alpine node --version @@ -86,13 +86,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 - - #Use default Node version from GitHub Actions VM (Ubuntu) - #- name: Setup - # uses: actions/setup-node@v2 - # with: - # node-version: 12 + uses: actions/checkout@v3 - name: Install run: npm clean-install --ignore-scripts From d28fb4606912400f901d99dcc1bcf9533ba6a314 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 30 May 2022 10:23:27 +0200 Subject: [PATCH 28/33] Update tests.yml --- .github/workflows/tests.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 880ebd67..06c495da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,7 +47,7 @@ jobs: docker: - name: Docker (lts-alpine) + name: Docker runs-on: ubuntu-latest @@ -61,22 +61,24 @@ jobs: run: docker build --tag dr4ft-app . - name: Run container from image - run: docker run -d -p 1337:1337 --name dr4ft dr4ft-app + run: docker run --detach --name dr4ft -p 1337:1337 dr4ft-app - # TODO: This needs probably some tweaking or can be tested further - - name: Access Docker container + # TODO: Extend this and test e.g. creating a game via API + - name: Access dr4ft page run: wget http://localhost:1337 - name: Show information run: | docker --version echo - docker images + docker images dr4ft-app echo - docker ps -a + docker ps echo - echo "Node version (dr4ft container)" - docker run node:lts-alpine node --version + echo "Node version (dr4ft-app image)" + docker run dr4ft-app node --version + echo + docker top dr4ft lint: From 48fb9cb8b8ee821ee35b5325265d4d76abe75f19 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sat, 4 Jun 2022 19:09:10 +0200 Subject: [PATCH 29/33] Update tests.yml --- .github/workflows/tests.yml | 77 ++++++++++++++++++++++++------------- README.md | 24 ++++++------ 2 files changed, 63 insertions(+), 38 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 870841d3..6e87268c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Automated tests +name: CI on: push: @@ -13,52 +13,70 @@ on: - '**.md' jobs: - node: + node_nvmrc: + name: Node .nvmrc + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: npm + + - name: Install package.json + run: npm clean-install --ignore-scripts + + - name: Run postinstall scripts + run: npm run postinstall + + - name: Run tests + run: npm run test:js + + + node_active_versions: name: Node ${{ matrix.node_version }} + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.node_version == 'current' }} strategy: fail-fast: false matrix: node_version: + - lts/-1 - lts/* - current - runs-on: ubuntu-latest - - # Allow failues for most recent Node release - continue-on-error: ${{ matrix.node_version == 'current' }} - steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v3 - - name: Setup + - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: ${{ matrix.node_version }} cache: npm - # See https://github.com/npm/cli/issues/2610 - - name: Workaround for Node 14 - if: matrix.node_version == '14' - run: sed -i 's/git+ssh/git+https/g' package-lock.json - - - name: Install - run: npm clean-install + - name: Install package.json + run: npm clean-install --ignore-scripts + + - name: Run postinstall scripts + run: npm run postinstall - - name: Test - run: npm run test + - name: Run tests + run: npm run test:js docker: name: Docker - runs-on: ubuntu-latest - continue-on-error: true steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v3 - name: Build image from Dockerfile @@ -83,22 +101,29 @@ jobs: docker run dr4ft-app node --version echo docker top dr4ft - + lint: name: ESLint - runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v3 - - name: Install + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: npm + + - name: Install package.json run: npm clean-install --ignore-scripts - name: Run ESLint run: | + echo "Node version" node --version - echo + echo "ESLint version" + npx eslint --version npm run lint diff --git a/README.md b/README.md index 8915a754..04ff5fb9 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ # dr4ft [![Discord](https://img.shields.io/discord/224178957103136779?label=Discord&logo=discord&logoColor=white&color=7289da)](https://mtgjson.com/discord) -*dr4ft* is a NodeJS based web-application that simulates draft and sealed format between players and/or bots. -Most of MTG sets are playable thanks to MTGJson support. We follow as much as possible the rules that determine how a real booster is created. +*dr4ft* is a Node.js based web-application that simulates draft and sealed format between players and/or bots. +Most of MTG sets are playable thanks to MTGJSON support. We follow as much as possible the rules that determine how a real booster is created. The application provides the following features: @@ -64,10 +64,9 @@ It supports all their features, and many more. ### Native -1) Install [Node.js](https://nodejs.org/en/download/) >= 16.0.0. Alternatively, install [nvm](https://github.com/nvm-sh/nvm) and then run `nvm use` in this repo, which will install the correct Node version for this repo as defined in the `.nvmrc` file. +1) Install [Node.js](https://nodejs.org/en/download/) >= 16.0.0
Alternatively, install [nvm](https://github.com/nvm-sh/nvm) and run `nvm use` in the project root to install a correct Node version for this repo as defined in the [`.nvmrc`](.nvmrc) file. 2) Run
`$ npm ci`
-`$ npm run build`
`$ npm start` 3) Visit [http://localhost:1337](http://localhost:1337) @@ -86,17 +85,17 @@ You can also create a Docker image and run the app in a container: ### Start Server -`npm start` -This command start the server +- `npm start` +This command starts the server. -`npm run download_allsets` -This command downloads all sets from MTGJson and integrates them. +- `npm run download_allsets` +This command downloads all sets from [MTGJSON](https://mtgjson.com) and integrates them. -`npm run update_database` -This command downloads integrates all files previously downloaded from MTGJson. +- `npm run update_database` +This command downloads and integrates all files previously downloaded from MTGJSON. -`npm run download_booster_rules` - download and parse booster generation rules from [magic-sealed-data](https://github.com/taw/magic-sealed-data) +- `npm run download_booster_rules` +This command downloads and parses booster generation rules from [taw/magic-sealed-data](https://github.com/taw/magic-sealed-data) ## Development Notes @@ -140,6 +139,7 @@ Pull requests are welcome. For major changes, please open an issue first to disc Please make sure to update tests as appropriate. +

The project is unaffiliated with Wizards of the Coast, and is licensed under the MIT license.

From ed2901baa09075dca6e3fbfa745dd357b1ffb92c Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 1 May 2023 21:30:57 +0200 Subject: [PATCH 30/33] test getting node from package.json --- .github/workflows/tests.yml | 48 +++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6e87268c..a2f6bca2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,19 +36,9 @@ jobs: - name: Run tests run: npm run test:js - - node_active_versions: - name: Node ${{ matrix.node_version }} + node_package: + name: Node package.json runs-on: ubuntu-latest - continue-on-error: ${{ matrix.node_version == 'current' }} - - strategy: - fail-fast: false - matrix: - node_version: - - lts/-1 - - lts/* - - current steps: - name: Checkout repository @@ -57,7 +47,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node_version }} + node-version-file: 'package.json' cache: npm - name: Install package.json @@ -69,6 +59,38 @@ jobs: - name: Run tests run: npm run test:js +# node_active_versions: +# name: Node ${{ matrix.node_version }} +# runs-on: ubuntu-latest +# continue-on-error: ${{ matrix.node_version == 'current' }} +# +# strategy: +# fail-fast: false +# matrix: +# node_version: +# - lts/-1 +# - lts/* +# - current +# +# steps: +# - name: Checkout repository +# uses: actions/checkout@v3 +# +# - name: Setup Node.js +# uses: actions/setup-node@v3 +# with: +# node-version: ${{ matrix.node_version }} +# cache: npm +# +# - name: Install package.json +# run: npm clean-install --ignore-scripts +# +# - name: Run postinstall scripts +# run: npm run postinstall +# +# - name: Run tests +# run: npm run test:js + docker: name: Docker From a13001895d806aea5e230dc7ffd8ab58b3e227db Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 1 May 2023 22:32:00 +0200 Subject: [PATCH 31/33] updates --- .github/workflows/tests.yml | 47 ++++++++++++++----------------------- Dockerfile | 7 ++++-- 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a2f6bca2..c39a8149 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,44 +13,30 @@ on: - '**.md' jobs: - node_nvmrc: - name: Node .nvmrc - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: npm - - name: Install package.json - run: npm clean-install --ignore-scripts - - - name: Run postinstall scripts - run: npm run postinstall - - - name: Run tests - run: npm run test:js - - node_package: - name: Node package.json + node: + name: Node.js (${{matrix.node_version_file}}) runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node_version_file: + - .nvmrc + - package.json + steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Setup Node.js + - name: Setup Node.js from ${{matrix.node_version_file}} file uses: actions/setup-node@v3 with: - node-version-file: 'package.json' + node-version-file: ${{matrix.node_version_file}} cache: npm + cache-dependency-path: 'package-lock.json' - - name: Install package.json + - name: Install modules from package.json run: npm clean-install --ignore-scripts - name: Run postinstall scripts @@ -81,6 +67,7 @@ jobs: # with: # node-version: ${{ matrix.node_version }} # cache: npm +# cache-dependency-path: 'package-lock.json' # # - name: Install package.json # run: npm clean-install --ignore-scripts @@ -133,14 +120,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Setup Node.js + - name: Setup Node.js from .nvmrc file uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' cache: npm - - name: Install package.json - run: npm clean-install --ignore-scripts + - name: Install ESLint + run: npm clean-install eslint --ignore-scripts - name: Run ESLint run: | diff --git a/Dockerfile b/Dockerfile index 0fabc240..dcbda842 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,11 @@ RUN adduser -S dr4ftuser RUN chown dr4ftuser -R . USER dr4ftuser -# Install the dependencies -RUN npm ci +# Install dependencies +RUN npm clean-install --ignore-scripts + +# Run postinstall scripts +RUN npm run postinstall # Publish the port 1337 EXPOSE 1337 From a1f9a6b105b8e5e3d4870999b704f5ea05240fb4 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sat, 28 Oct 2023 10:41:42 +0200 Subject: [PATCH 32/33] bump --- .github/workflows/tests.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c39a8149..dd74bb85 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,10 +27,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js from ${{matrix.node_version_file}} file - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: ${{matrix.node_version_file}} cache: npm @@ -60,10 +60,10 @@ jobs: # # steps: # - name: Checkout repository -# uses: actions/checkout@v3 +# uses: actions/checkout@v4 # # - name: Setup Node.js -# uses: actions/setup-node@v3 +# uses: actions/setup-node@v4 # with: # node-version: ${{ matrix.node_version }} # cache: npm @@ -86,7 +86,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build image from Dockerfile run: docker build --tag dr4ft-app . @@ -118,10 +118,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js from .nvmrc file - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: npm From 5ae3a902af6a3d3dc3340808edef8242dc2354cc Mon Sep 17 00:00:00 2001 From: tooomm Date: Sat, 28 Oct 2023 10:57:05 +0200 Subject: [PATCH 33/33] cleanup --- .github/workflows/tests.yml | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd74bb85..2ebf5a60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,39 +45,6 @@ jobs: - name: Run tests run: npm run test:js -# node_active_versions: -# name: Node ${{ matrix.node_version }} -# runs-on: ubuntu-latest -# continue-on-error: ${{ matrix.node_version == 'current' }} -# -# strategy: -# fail-fast: false -# matrix: -# node_version: -# - lts/-1 -# - lts/* -# - current -# -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 -# -# - name: Setup Node.js -# uses: actions/setup-node@v4 -# with: -# node-version: ${{ matrix.node_version }} -# cache: npm -# cache-dependency-path: 'package-lock.json' -# -# - name: Install package.json -# run: npm clean-install --ignore-scripts -# -# - name: Run postinstall scripts -# run: npm run postinstall -# -# - name: Run tests -# run: npm run test:js - docker: name: Docker @@ -125,6 +92,7 @@ jobs: with: node-version-file: '.nvmrc' cache: npm + cache-dependency-path: 'package-lock.json' - name: Install ESLint run: npm clean-install eslint --ignore-scripts