Skip to content

Commit

Permalink
Merge pull request #17 from Project-Fungus/prepare-for-release
Browse files Browse the repository at this point in the history
Prepare for release
  • Loading branch information
louis-hildebrand authored Dec 18, 2023
2 parents 1c5d8e0 + a990d9d commit a40c733
Show file tree
Hide file tree
Showing 20 changed files with 13,172 additions and 3,587 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"linebreak-style": [
"error",
"windows"
"unix"
],
"quotes": [
"error",
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
release:
description: "Build for release?"
required: true
default: false
type: boolean

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
- run: npm ci
- run: npm test
- run: npm run lint
build_release:
if: ${{ inputs.release }}
needs: test
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
- { os: macos-12 , artifact-name: fungus-gui-macos }
- { os: windows-2022, artifact-name: fungus-gui-windows }
- { os: ubuntu-22.04, artifact-name: fungus-gui-linux }
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
- run: npm ci
- name: Install dependency for building dmg
if: runner.os == 'macOS'
shell: bash
# https://github.com/actions/runner/issues/2958#issuecomment-1852627308
run: sudo -H pip install setuptools && npm install appdmg
- run: npm run make
- name: Upload zip artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.job.artifact-name }}-zip
path: out/make/zip/**/*.zip
if-no-files-found: error
- name: Upload squirrel artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.job.artifact-name }}-squirrel
path: out/make/squirrel.windows/
if-no-files-found: error
- name: Upload deb artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.job.artifact-name }}-deb
path: out/make/deb/
if-no-files-found: error
- name: Upload rpm artifact
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.job.artifact-name }}-rpm
path: out/make/rpm/
if-no-files-found: error
- name: Upload dmg artifact
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.job.artifact-name }}-dmg
path: out/make/*.dmg
if-no-files-found: error
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
.vscode/
coverage/
verdicts.json
out/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Project-Fungus

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.
34 changes: 10 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
# electron-gui
# fungus-gui

Desktop GUI written using the Electron framework.
Desktop GUI for the FUNGUS plagiarism detection tool.

## Starting the App
## Installation

Run
```
npm run start
```
First, you must [install the FUNGUS command-line tool](https://github.com/Project-Fungus/fungus-cli?tab=readme-ov-file#installation).

## Linting
Then, to install the GUI, find the artifact for your platform on the [Releases page](https://github.com/Project-Fungus/fungus-gui/releases).

Run
```
npm run lint
```
## Development Tasks

## Testing the App

### Unit Tests

Run
```
npm run test
```

### Manual Tests

Run the app normally and then open one of the JSON files in `/test/` along with the `/test/projects/` directory. Play around and check that everything looks normal. Note that `unreadable-file.json` is meant to simulate what happens when the user tries to open a file that can't be read, so you should make sure you do *not* have permission to read it.
- Start the app with `npm run start`.
- Run the linter with `npm run lint`.
- Run the unit tests with `npm run test`.
- For manual testing, run the app normally and then open one of the JSON files in `/test/` along with the `/test/projects/` directory. Play around and check that everything looks normal. Note that `unreadable-file.json` is meant to simulate what happens when the user tries to open a file that can't be read, so you should make sure you do *not* have permission to read it.
51 changes: 51 additions & 0 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const fs = require("fs");
const path = require("path");
const glob = require("glob");

module.exports = {
hooks: {
// github.com/electron/packager/issues/1444#issuecomment-1690130930
packageAfterPrune(_, buildPath) {
if (process.platform !== "darwin") return;
const dirs = glob.sync(
path.join(buildPath, "node_modules/**/node_gyp_bins"),
{ onlyDirectories: true }
);
for (const directory of dirs) {
fs.rmdirSync(directory, { recursive: true, force: true });
}
},
},
packagerConfig: {
asar: true,
},
rebuildConfig: {},
makers: [
{
name: "@electron-forge/maker-squirrel",
config: {},
},
{
name: "@electron-forge/maker-zip",
platforms: ["darwin", "linux", "win32"],
},
{
name: "@electron-forge/maker-deb",
config: {},
},
{
name: "@electron-forge/maker-rpm",
config: {},
},
{
name: "@electron-forge/maker-dmg",
platforms: ["darwin"]
}
],
plugins: [
{
name: "@electron-forge/plugin-auto-unpack-natives",
config: {},
},
],
};
Binary file added img/help-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/one-project-pairs-stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/open-files-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/project-pairs-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/warnings-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a40c733

Please sign in to comment.