From d80449e5ed4de5bcd51d57523b4f92f04c04923f Mon Sep 17 00:00:00 2001 From: Antoine Greuzard Date: Fri, 1 Nov 2024 08:55:01 +0100 Subject: [PATCH 1/2] Develop (#80) * Feature/save game (#65) * feat: add saving game * refactor * fix * fix: some bug * feat: better ai * fix: tests en passant * fix: isValidMove returns true for en passant capture * fix: isValidMove returns true for en passant capture * fix: add true * Create CODE_OF_CONDUCT.md Signed-off-by: Antoine Greuzard * Update issue templates * refactor ai * refactor board * refactor piece * refactor pieces * refactor utils * refactor canvas * refactor timer * fix: drag impossible on ai pieces * fix: remove save game --------- Signed-off-by: Antoine Greuzard Co-authored-by: Antoine GREUZARD * fix: remove saveGameToFile * Update pull_request_template.md Signed-off-by: Antoine Greuzard * fix: remove saveGameToFile * refactor: add ai folder * Create dependabot.yml Signed-off-by: Antoine Greuzard --------- Signed-off-by: Antoine Greuzard Co-authored-by: Antoine GREUZARD --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5f0889c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "npm" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From b7a598f870b4305baca44d41d07e82893f5683b6 Mon Sep 17 00:00:00 2001 From: Antoine Greuzard Date: Fri, 1 Nov 2024 09:07:07 +0100 Subject: [PATCH 2/2] Add some jobs (#84) * Feature/save game (#65) * feat: add saving game * refactor * fix * fix: some bug * feat: better ai * fix: tests en passant * fix: isValidMove returns true for en passant capture * fix: isValidMove returns true for en passant capture * fix: add true * Create CODE_OF_CONDUCT.md Signed-off-by: Antoine Greuzard * Update issue templates * refactor ai * refactor board * refactor piece * refactor pieces * refactor utils * refactor canvas * refactor timer * fix: drag impossible on ai pieces * fix: remove save game --------- Signed-off-by: Antoine Greuzard Co-authored-by: Antoine GREUZARD * fix: remove saveGameToFile * Update pull_request_template.md Signed-off-by: Antoine Greuzard * fix: remove saveGameToFile * refactor: add ai folder * Create dependabot.yml Signed-off-by: Antoine Greuzard * feat: add some jobs * fix: add token --------- Signed-off-by: Antoine Greuzard Co-authored-by: Antoine GREUZARD --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38b6bd1..1ce918e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,36 +14,59 @@ jobs: runs-on: ubuntu-latest steps: - # Checkout du dépôt + # Checkout du dépôt - name: Checkout code uses: actions/checkout@v4 - # Configuration de Node.js + # Configuration de Node.js - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 20 # Assurez-vous d'utiliser une version compatible avec votre projet - # Installation des dépendances + # Cache Node modules + - name: Cache Node modules + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + # Run Security Audit + - name: Run Security Audit + run: npm audit + + # Installation des dépendances - name: Install dependencies run: npm install - # Test de la compilation TypeScript + # Test de la compilation TypeScript - name: Build TypeScript run: npm run build - # Lancer les tests unitaires + # Lancer les tests unitaires - name: Run Unit Tests run: npm test - # Lancer Prettier pour formater le code + # Coverage tests + - name: Generate Coverage Report + run: npm run test -- --coverage + + # Lancer Prettier pour formater le code - name: Run Prettier run: npm run prettier-check - # Lancer ESLint pour vérifier la qualité du code + # Lancer ESLint pour vérifier la qualité du code - name: Run ESLint run: npm run lint + # Check bundle size + - name: Check bundle size + uses: andresz1/size-limit-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + deploy: runs-on: ubuntu-latest permissions: @@ -52,25 +75,25 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }} needs: build-and-test steps: - # Checkout du dépôt + # Checkout du dépôt - name: Checkout code uses: actions/checkout@v4 - # Configuration de Node.js + # Configuration de Node.js - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 20 - # Installation des dépendances + # Installation des dépendances - name: Install dependencies run: npm install - # Construction de l'application + # Construction de l'application - name: Build TypeScript run: npm run build - # Déploiement sur GitHub Pages + # Déploiement sur GitHub Pages - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: