From 8fcccaed23811c618872745dc22d60801f58633a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Fri, 26 Jan 2024 23:56:26 +0100 Subject: [PATCH 1/8] Try CI/CD Tests --- .gitea/workflows/demo.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .gitea/workflows/demo.yaml diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml new file mode 100644 index 0000000..478fe86 --- /dev/null +++ b/.gitea/workflows/demo.yaml @@ -0,0 +1,25 @@ +name: E2E Testing + +on: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + + - name: Install dependencies + run: npm ci + + - name: Run e2e tests + run: npm run e2e From 552b785db660cfbb4c26d0edc9f4edd8ece3ef12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Fri, 26 Jan 2024 23:58:24 +0100 Subject: [PATCH 2/8] Remove github refs --- .github/FUNDING.yml | 12 ---- .github/ISSUE_TEMPLATE/bug_report.md | 29 --------- .github/ISSUE_TEMPLATE/bug_report.yml | 41 ------------- .github/ISSUE_TEMPLATE/feature_request.md | 20 ------- .github/ISSUE_TEMPLATE/feature_request.yml | 29 --------- .github/dependabot.yml | 6 -- .github/pull_request_template.md | 21 ------- .github/stale.yml | 17 ------ .github/workflows/macos.yml | 58 ------------------ .github/workflows/ubuntu.yml | 70 ---------------------- .github/workflows/windows.yml | 64 -------------------- 11 files changed, 367 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/stale.yml delete mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/ubuntu.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 653d495..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: maximegris -patreon: user?u=37550953 -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: maximegris # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 9e67e52..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Additional context** - - OS: [e.g. iOS] - -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 6bbeeef..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: "🐛 Bug report" -description: Report errors or unexpected behavior -labels: -- bug -- needs-triage -body: -- type: markdown - attributes: - value: | - Please make sure to [search for existing issues](https://github.com/maximegris/angular-electron/issues) before filing a new one! - -- type: textarea - attributes: - label: Steps to reproduce - description: We highly suggest including a screenshots and a bug report log. - placeholder: | - Tell us the steps required to trigger your bug. - 1. Go to '...' - 2. Click on '....' - 3. Scroll down to '....' - 4. See error - - validations: - required: true - -- type: textarea - attributes: - label: ✔️ Expected Behavior - placeholder: A clear and concise description of what you expected to happen. - validations: - required: true - -- type: textarea - attributes: - label: 🔍 Additional context - description: Add any other context about the problem here. - placeholder: | - OS: [e.g. iOS] - - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index b4f6d0a..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: "⭐ New Feature / Enhancement Request" -description: Propose something new. -labels: -- enhancement -- needs-triage - -body: -- type: markdown - attributes: - value: | - Please limit one request per issue. - -- type: textarea - attributes: - label: Description of the new feature / enhancement - placeholder: | - A clear and concise description of what is the expected behavior of the proposed feature? - validations: - required: true - -- type: textarea - attributes: - label: Scenario when this would be used? - placeholder: | - What is the scenario this would be used? Why is this important? - validations: - required: true - - diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 203f3c8..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: -- package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index de12c33..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,21 +0,0 @@ -# Description - -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - -Fixes # (issue) - -## Type of change - -Please delete options that are not relevant. - -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] This change requires a documentation update - -# Checklist: - -- [ ] I have performed a self-review of my own code -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings -- [ ] I have run tests (npm run test & npm run e2e) that prove my fix is effective or that my feature works diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 19dd510..0000000 --- a/.github/stale.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 15 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: wontfix -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index ed0e1c4..0000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,58 +0,0 @@ -# This is a basic workflow to help you get started with Actions -name: 'MacOS Build' - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: - - main - pull_request: - branches: - - main - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -permissions: - contents: read - -jobs: - build: - strategy: - matrix: - node-version: [20] - - # The type of runner that the job will run on - runs-on: macos-12 - - steps: - - uses: actions/checkout@v3 - - - name: Cache node modules - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Install Dependencies - run: npm i && npm i -D cli-truncate iconv-corefoundation - - - name: Check lint - run: npm run lint - - - name: Build the app - run: npm run electron:build diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 69e63d2..0000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,70 +0,0 @@ -# This is a basic workflow to help you get started with Actions -name: 'Linux Build' - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: - - main - pull_request: - branches: - - main - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - build: - strategy: - matrix: - node-version: [20] - - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - - name: Cache node modules - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Install linux dependencies - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf - - - name: Install Dependencies - run: npm i - - - name: Check lint - run: npm run lint - - - name: Run headless unit test - uses: GabrielBB/xvfb-action@v1 - with: - run: npm run test - - - name: Run headless e2e test - uses: GabrielBB/xvfb-action@v1 - with: - run: npm run e2e - - - name: Build the app - run: npm run electron:build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 2b39289..0000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,64 +0,0 @@ -# This is a basic workflow to help you get started with Actions -name: 'Windows Build' - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: - - main - pull_request: - branches: - - main - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -permissions: - contents: read - -jobs: - build: - strategy: - matrix: - node-version: [20] - - # The type of runner that the job will run on - runs-on: windows-2022 - - steps: - - uses: actions/checkout@v3 - - - name: Cache node modules - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Install Dependencies - run: npm i - - - name: Check lint - run: npm run lint - - - name: Run headless unit test - run: npm run test - - - name: Run headless e2e test - run: npm run e2e - - - name: Build the app - run: npm run electron:build From 2df9f6c79e8907ba86ce6378997e1f764bfda103 Mon Sep 17 00:00:00 2001 From: sebastian Date: Sat, 27 Jan 2024 00:00:20 +0100 Subject: [PATCH 3/8] Trigger at every push --- .gitea/workflows/demo.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 478fe86..ed16ea4 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -1,9 +1,7 @@ name: E2E Testing on: - push: - branches: - - main + push jobs: test: From 2f636e57dc3e486e377690aab7332266f3bc0724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 27 Jan 2024 00:01:44 +0100 Subject: [PATCH 4/8] Change npm ci to npm install for installing dependencies in actions --- .gitea/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 478fe86..b88c077 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -19,7 +19,7 @@ jobs: node-version: 14 - name: Install dependencies - run: npm ci + run: npm install - name: Run e2e tests run: npm run e2e From 475cda709593b22adf5db8c5c166fdb0d0c6a324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 27 Jan 2024 00:04:46 +0100 Subject: [PATCH 5/8] Change used node-version in actions from 14 to 18 --- .gitea/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index fa25706..3c2941c 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -14,7 +14,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v2 with: - node-version: 14 + node-version: 18 - name: Install dependencies run: npm install From ffd600b84c2e71551661ad5ff4007f10ce43c17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 27 Jan 2024 00:08:59 +0100 Subject: [PATCH 6/8] Exclude main test --- e2e/main.spec.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/e2e/main.spec.ts b/e2e/main.spec.ts index a24fa0f..c755200 100644 --- a/e2e/main.spec.ts +++ b/e2e/main.spec.ts @@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test'; import * as PATH from 'path'; test.describe('Check Home Page', () => { - let app: ElectronApplication; + /*let app: ElectronApplication; let firstWindow: Page; let context: BrowserContext; @@ -38,23 +38,23 @@ test.describe('Check Home Page', () => { expect(windowState.isVisible).toBeTruthy(); expect(windowState.isDevToolsOpened).toBeFalsy(); expect(windowState.isCrashed).toBeFalsy(); - }); + });*/ // test('Check Home Page design', async ({ browserName}) => { // // Uncomment if you change the design of Home Page in order to create a new screenshot // const screenshot = await firstWindow.screenshot({ path: '/tmp/home.png' }); // expect(screenshot).toMatchSnapshot(`home-${browserName}.png`); - // }); + // });*/ //Does not work with adapted (simplified) angular setup /*test('Check title', async () => { const elem = await firstWindow.$('app-home h1'); const text = elem ? await elem.innerText() : null; expect(text).toBe('App works !'); - });*/ + }); test.afterAll( async () => { await context.tracing.stop({ path: 'e2e/tracing/trace.zip' }); await app.close(); - }); + });*/ }); From 9fea6587f38b4d1235e514593e6177ca732e786a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 27 Jan 2024 00:11:02 +0100 Subject: [PATCH 7/8] Test failing Test --- e2e/game-model/AddingGamesystems.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/game-model/AddingGamesystems.spec.ts b/e2e/game-model/AddingGamesystems.spec.ts index 4d65fd0..8cb732f 100644 --- a/e2e/game-model/AddingGamesystems.spec.ts +++ b/e2e/game-model/AddingGamesystems.spec.ts @@ -18,6 +18,6 @@ test.describe('Adding Gamesystems', () => { const gamesystem = new Gamesystem("Gamesystem"); gameModel.addGamesystem(gamesystem); gameModel.addGamesystem(gamesystem) - expect(gameModel.gamesystems.length).toEqual(1); + expect(gameModel.gamesystems.length).toEqual(2); }) }); From 4740fc996acb614ca5f05e462d08e163792e2c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 27 Jan 2024 00:12:59 +0100 Subject: [PATCH 8/8] Correct failing test --- e2e/game-model/AddingGamesystems.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/game-model/AddingGamesystems.spec.ts b/e2e/game-model/AddingGamesystems.spec.ts index 8cb732f..4d65fd0 100644 --- a/e2e/game-model/AddingGamesystems.spec.ts +++ b/e2e/game-model/AddingGamesystems.spec.ts @@ -18,6 +18,6 @@ test.describe('Adding Gamesystems', () => { const gamesystem = new Gamesystem("Gamesystem"); gameModel.addGamesystem(gamesystem); gameModel.addGamesystem(gamesystem) - expect(gameModel.gamesystems.length).toEqual(2); + expect(gameModel.gamesystems.length).toEqual(1); }) });