From 6b59a58ea39f51e8d957f3e331c3f77236048f05 Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Tue, 21 Dec 2021 13:07:51 -0500 Subject: [PATCH 1/2] Fix linter errors --- src/NetscriptFunctions/Singularity.ts | 4 ++-- src/Terminal/commands/common/editor.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 3c185e602..99b960856 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -819,7 +819,7 @@ export function NetscriptSingularity( return player.getUpgradeHomeRamCost(); }, - workForCompany: function (companyName: any, focus: boolean = true): any { + workForCompany: function (companyName: any, focus = true): any { helper.updateDynamicRam("workForCompany", getRamCost("workForCompany")); helper.checkSingularityAccess("workForCompany", 2); @@ -991,7 +991,7 @@ export function NetscriptSingularity( workerScript.log("joinFaction", () => `Joined the '${name}' faction.`); return true; }, - workForFaction: function (name: any, type: any, focus: boolean = true): any { + workForFaction: function (name: any, type: any, focus = true): any { helper.updateDynamicRam("workForFaction", getRamCost("workForFaction")); helper.checkSingularityAccess("workForFaction", 2); getFaction("workForFaction", name); diff --git a/src/Terminal/commands/common/editor.ts b/src/Terminal/commands/common/editor.ts index a76237e85..bf5c23960 100644 --- a/src/Terminal/commands/common/editor.ts +++ b/src/Terminal/commands/common/editor.ts @@ -19,12 +19,12 @@ function isNs2(filename: string): boolean { const newNs2Template = `/** @param {NS} ns **/ export async function main(ns) { - + }`; export function commonEditor( command: string, - { terminal, router, player, server, args }: EditorParameters, + { terminal, router, player, args }: EditorParameters, scriptEditorRouteOptions?: ScriptEditorRouteOptions, ): void { if (args.length < 1) { From d6c1f3bfca65eea4c5d770fe73c16f764651efa8 Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Wed, 22 Dec 2021 04:18:15 -0500 Subject: [PATCH 2/2] Split CI into multiple jobs to get clearer results --- .github/workflows/ci.yml | 74 +++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01643cd66..801c0b649 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,3 @@ -# This is a basic workflow to help you get started with Actions name: CI on: @@ -13,39 +12,44 @@ on: jobs: build: - # The type of runner that the job will run on + name: Build runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16.13.1] - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - uses: actions/checkout@v2 - - run: echo "The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "The workflow is now ready to test your code on the runner." - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - name: Install npm dependencies - run: npm ci - - name: Run unit tests - run: npm run test - - name: Run linter - run: npm run lint:report - - name: Build the web app - run: npm run build - - # Cannot build the electron app by default using ubuntu - # Wrapper command 'wine64' not found on the system. Consult your Linux distribution's package manager to determine how to install Wine. - # - name: Build the electron app - # run: ./package.sh - - # Unable to properly run the cypress tests for now, they are throwing errors. - # - name: Run the integration tests - # run: npm run cy:test + - uses: actions/checkout@v2 + - name: Use Node.js 16.13.1 + uses: actions/setup-node@v2 + with: + node-version: 16.13.1 + cache: 'npm' + - name: Install npm dependencies + run: npm ci + - name: Build the production app + run: npm run build + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 16.13.1 + uses: actions/setup-node@v2 + with: + node-version: 16.13.1 + cache: 'npm' + - name: Install npm dependencies + run: npm ci + - name: Run linter + run: npm run lint:report + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 16.13.1 + uses: actions/setup-node@v2 + with: + node-version: 16.13.1 + cache: 'npm' + - name: Install npm dependencies + run: npm ci + - name: Run linter + run: npm run test