From 3fd2a753aee742c1a2b52709d38badd0ae395cba Mon Sep 17 00:00:00 2001
From: Pasha Shchukin
Date: Mon, 11 Nov 2024 16:50:43 +0200
Subject: [PATCH 1/7] add task solution
---
.github/workflows/test.yml-template | 29 ++++
README.md | 2 +-
package-lock.json | 8 +-
package.json | 2 +-
src/index.html | 2 +-
src/modules/Game.class.js | 205 ++++++++++++++++++++++++++--
src/scripts/main.js | 84 +++++++++++-
7 files changed, 311 insertions(+), 21 deletions(-)
create mode 100644 .github/workflows/test.yml-template
diff --git a/.github/workflows/test.yml-template b/.github/workflows/test.yml-template
new file mode 100644
index 000000000..44ac4e963
--- /dev/null
+++ b/.github/workflows/test.yml-template
@@ -0,0 +1,29 @@
+name: Test
+
+on:
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [20.x]
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - run: npm install
+ - run: npm start & sleep 5 && npm test
+ - name: Upload tests report(cypress mochaawesome merged HTML report)
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: report
+ path: reports
diff --git a/README.md b/README.md
index 5aab92544..e40cec244 100644
--- a/README.md
+++ b/README.md
@@ -61,7 +61,7 @@ You can change the HTML/CSS layout if you need it.
## Deploy and Pull Request
1. Replace `` with your Github username in the link
- - [DEMO LINK](https://.github.io/js_2048_game/)
+ - [DEMO LINK](https://pasha28091997.github.io/js_2048_game/)
2. Follow [this instructions](https://mate-academy.github.io/layout_task-guideline/)
- Run `npm run test` command to test your code;
- Run `npm run test:only -- -n` to run fast test ignoring linter;
diff --git a/package-lock.json b/package-lock.json
index f209cb6e0..755cd3c2e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,7 +14,7 @@
"@mate-academy/eslint-config": "latest",
"@mate-academy/jest-mochawesome-reporter": "^1.0.0",
"@mate-academy/linthtml-config": "latest",
- "@mate-academy/scripts": "^1.8.5",
+ "@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"cypress": "^13.13.0",
@@ -1467,9 +1467,9 @@
"dev": true
},
"node_modules/@mate-academy/scripts": {
- "version": "1.8.5",
- "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.8.5.tgz",
- "integrity": "sha512-mHRY2FkuoYCf5U0ahIukkaRo5LSZsxrTSgMJheFoyf3VXsTvfM9OfWcZIDIDB521kdPrScHHnRp+JRNjCfUO5A==",
+ "version": "1.9.12",
+ "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.9.12.tgz",
+ "integrity": "sha512-/OcmxMa34lYLFlGx7Ig926W1U1qjrnXbjFJ2TzUcDaLmED+A5se652NcWwGOidXRuMAOYLPU2jNYBEkKyXrFJA==",
"dev": true,
"dependencies": {
"@octokit/rest": "^17.11.2",
diff --git a/package.json b/package.json
index 0335978ca..05abe81e0 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"@mate-academy/eslint-config": "latest",
"@mate-academy/jest-mochawesome-reporter": "^1.0.0",
"@mate-academy/linthtml-config": "latest",
- "@mate-academy/scripts": "^1.8.5",
+ "@mate-academy/scripts": "^1.9.12",
"@mate-academy/stylelint-config": "latest",
"@parcel/transformer-sass": "^2.12.0",
"cypress": "^13.13.0",
diff --git a/src/index.html b/src/index.html
index aff3d1a98..1288441ad 100644
--- a/src/index.html
+++ b/src/index.html
@@ -65,6 +65,6 @@ 2048
-
+