-
Notifications
You must be signed in to change notification settings - Fork 1
Prepare build workflow in GitHub #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e09e67e
Sync files from GitLab (#1)
MartinGroscheTT a260f2b
Add GitHub Actions workflow for building extension (#1)
MartinGroscheTT 2aca24d
Disable ESLint and TSLint rules in test setup for chrome API mocking …
MartinGroscheTT 8661cd2
Update import statement to use .js extension for types (#1)
MartinGroscheTT 43dad4f
Upgrade dependencies and clean project (#1)
MartinGroscheTT e0dc993
Fix zip file creation path in GitHub Actions workflow (#1)
MartinGroscheTT 07a84ca
Update GitHub Actions workflow to upload built extension files direct…
MartinGroscheTT b8c3313
Update review notes (#1)
MartinGroscheTT f7ce39d
Sync internal GitLab repo (#1)
MartinGroscheTT 27b899b
Refactor GitHub Actions workflow to separate testing into its own fil…
MartinGroscheTT 0fa7196
Remove workflow_dispatch trigger from test workflow configuration (#1)
MartinGroscheTT 9c90212
Refactor build workflow to use separate test workflow file (#1)
MartinGroscheTT 1d7e1de
Enhance test workflow to support multiple Node.js versions (#1)
MartinGroscheTT 4c2025b
Update documentation structure and add CI information (#1)
MartinGroscheTT 06b6e64
Provide REUSE compliance check workflow (#1)
MartinGroscheTT f6f6de8
Add SPDX SBOM generation and upload to REUSE workflow (#1)
MartinGroscheTT df1115c
Update Developer Guide to clarify SBOM output location in REUSE workf…
MartinGroscheTT e410125
Rename workflow (#1)
MartinGroscheTT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| dist | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "parser": "@typescript-eslint/parser", | ||
| "plugins": [ | ||
| "@typescript-eslint" | ||
| ], | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/eslint-recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "prettier" | ||
| ], | ||
| "env": { | ||
| "browser": true, | ||
| "node": true, | ||
| "mocha": true | ||
| }, | ||
| "rules": { | ||
| "@typescript-eslint/no-var-requires": 0 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: Build Chrome Extension | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [18, 20] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: 'npm' | ||
| cache-dependency-path: 'package-lock.json' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Lint code | ||
| run: npm run lint | ||
|
|
||
| - name: Run tests | ||
| run: npm test | ||
| build: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| browser: [chrome, firefox] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node v20 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: 'npm' | ||
| cache-dependency-path: 'package-lock.json' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build extension for ${{ matrix.browser }} | ||
| run: npm run build-${{ matrix.browser }} | ||
|
|
||
| - name: Upload extension zip | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.browser }}-extension | ||
| path: dist/* | ||
| if-no-files-found: error | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| dist | ||
| coverage | ||
| node_modules | ||
| .DS_Store | ||
| .env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "required": ["ts-node/register", "tsconfig-paths/register"], | ||
| "extension": ["ts", "js"], | ||
| "loader": "ts-node/esm", | ||
| "spec": ["./test/setup.ts", "./test/**/*.ts"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| dist | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "trailingComma": "all", | ||
| "printWidth": 80, | ||
| "endOfLine": "auto", | ||
| "tabWidth": 2 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2025 tracetronic GmbH | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,122 @@ | ||
| # ecu.test-diff | ||
| <!-- | ||
| SPDX-FileCopyrightText: 2025 tracetronic GmbH | ||
|
|
||
| SPDX-License-Identifier: MIT | ||
| --> | ||
|
|
||
|  | ||
|
|
||
| Browser plugin to open the diff viewer of tracetronic products ecu.test and trace.check from browser. | ||
|
|
||
| ## Announcements | ||
|
|
||
| *Nothing to see here yet.* | ||
|
|
||
| ## Features | ||
|
|
||
| ecu.test Diff Extension is a bridge between the current browser tab and an installed ecu.test. It allows you to diff packages (`.pkg`) and other artifacts | ||
| from an open commit or merge request with only a few simple clicks. | ||
|
|
||
| SCM platforms: | ||
| - Github | ||
| - Gitlab | ||
|
|
||
| Supported entry points | ||
| - Single commits | ||
| - Merges | ||
|
|
||
| Detected file extensions | ||
| - `.pkg` | ||
| - `.prj` | ||
| - `.trf` (view only, no diff) | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Installing and running | ||
|
|
||
| TODO: The extention is not yet released on chrome or firefox app stores! | ||
|
|
||
| Use the extention in development mode (this mode is probably forbidden via company IT rules!): | ||
|
|
||
| **Firefox** | ||
|
|
||
| 1. Download the relevant .xpi file from releases. | ||
| 2. Go to `about:debugging#/runtime/this-firefox` | ||
| 3. Click on load temporary addon select the .xpi file. | ||
| **Chrome/Edge** | ||
|
|
||
| 1. Download the relevant .crx file from releases. | ||
| 2. Go to `chrome://extensions/` | ||
| 3. Enable development mode | ||
| 4. Drag .crx into the window (if it is not working, reload window once) | ||
|
|
||
| You are good to go! You can also pin the extension to the toolbar for easy access. | ||
|
|
||
| ### Usage | ||
| - Open a commit or merge request on your SCM platform. Open the extention popup dialog. | ||
| - Select the correct platform type and add the host. | ||
| - Go to the options. E.g., via click on the cog wheel icon. | ||
| - Now enter you API token. Don't give the token all permissions! Only reading repository and API access. So create fine-grained tokens! | ||
| - Save the settings | ||
| - Go back to the commit page and open the popup again. | ||
| - The supported files of the changes will be listed. | ||
| - Click on a file and click on "Show diff". | ||
| - ecu.test Diff-Viewer will be opened. This needs ecu.test installed and a valid license available! | ||
|
|
||
| ### Developer Guide | ||
| #### Install node.js | ||
| First you have to install [node.js](https://nodejs.org/en/download) to have access to the package manager npm for building the browser extension. | ||
| #### Install dependencies | ||
| Open the ecu.test diff project in your IDE of choice and run the following terminal command to install the dependencies including typescript: | ||
|
|
||
| ```npm install -g typescript``` | ||
|
|
||
| #### Build process | ||
| If you want to build the ecu.test diff extension locally for development purpose or for production use, you have access to different scripts: | ||
|
|
||
| **<u>Note:</u>** All of these scripts can be found and modified within the './package.json' of the project. | ||
|
|
||
| **Firefox:** | ||
| ``` | ||
| npm run start-firefox | ||
| npm run build-firefox | ||
| ``` | ||
| **Chrome/Edge:** | ||
| ``` | ||
| npm run start-chrome | ||
| npm run build-chrome | ||
| ``` | ||
| Your compiles files are available inside the './dist' folder after the build process. | ||
| For integration and testing into you browser you have to note some differences: | ||
|
|
||
| In Chrome/Edge you can just select the './dist' folder inside you browser windows for importing the extension. | ||
|
|
||
| In Firefox you can test the extension only in debug-mode. You have to klick on 'debug add-ons' and can afterwards select a .zip file for the import. You can create the .zip file on your own or use the tool web-ext (from mozilla). | ||
| ``` | ||
| npm install web-ext | ||
| cd ./dist | ||
| web-ext build | ||
| ``` | ||
| This tooling also provide a help in the ['signing' process](https://extensionworkshop.com/documentation/develop/extensions-and-the-add-on-id/) which is required for the use of add-ons without debug-mode in firefox. | ||
|
|
||
| #### Testing / Linting / Code formatting | ||
| For these purposes there are three additional scripts which execute the local tests, start the linter in the source code and do some code formatting: | ||
|
|
||
| ``` | ||
| npm run test | ||
| npm run lint | ||
| npm run prettier | ||
| ``` | ||
|
|
||
| #### Open-Source Software compliance | ||
| To ensure open-source complience with our provided software at tracetronic GmbH we use the tool [reuse](https://reuse.readthedocs.io/en/stable/readme.html). After installing the tooling in your local environment you can check for open-source compliance with: | ||
|
|
||
| ```reuse lint``` | ||
|
|
||
| If you want to add the SPDX-Headers automatically - in case there are a lot of files - you can do this with the following: | ||
|
|
||
| ```reuse annotate --copyright="tracetronic GmbH" --license=MIT -r <your_folder>/ ./<your_file>.ts``` | ||
|
|
||
| ### Licensing | ||
| This work is licensed under MIT license. This project is based on the boilerplate [Chrome Extension Webpack](https://github.com/sszczep/chrome-extension-webpack). | ||
|
|
||
| placeholder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| version = 1 | ||
| SPDX-PackageName = "ecu.test diff plugin" | ||
| SPDX-PackageSupplier = "2025 tracetronic GmbH <[email protected]>" | ||
| SPDX-PackageDownloadLocation = "https://hq-vcs-3.ad.tracetronic.de/TTS/browserplugins/diffplugin" | ||
|
|
||
| [[annotations]] | ||
| path = ["README.md", "webpack.prod.cjs", "webpack.common.cjs", "webpack.dev.cjs"] | ||
| precedence = "aggregate" | ||
| SPDX-FileCopyrightText = "2025 tracetronic GmbH" | ||
| SPDX-License-Identifier = "MIT" | ||
|
|
||
| [[annotations]] | ||
| path = ["static/fonts/**", "static/icons/**", "**.json", ".eslint*", ".gitignore", ".prettier*"] | ||
| precedence = "aggregate" | ||
| SPDX-FileCopyrightText = "none" | ||
| SPDX-License-Identifier = "MIT" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "presets": [ | ||
| "@babel/preset-env", | ||
| "@babel/preset-typescript" | ||
| ], | ||
| "plugins": ["@babel/plugin-transform-runtime"] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.