diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 000000000..39461ccd7 --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,41 @@ +name: Audit + +on: [pull_request] + +env: + WEBAPP_NAME: nwave # set this to your application's name + WEBAPP_PACKAGE_PATH: "." # set this to the path to your web app project, defaults to the repository root + NODE_VERSION: "16.13.1" # set this to the node version to use + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_READ_TOKEN }} + CI: false +jobs: + lighthouseci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + #always-auth: true + #registry-url: "https://npm.pkg.github.com" + - name: Yarn packages audit + run: yarn npm audit + continue-on-error: true + - name: Install, configure, install the lighthouse auditor + run: | + # Check the node version + node --version + corepack enable + # Install the project, then... + # yarn workspaces run init-project + yarn init-project + yarn install --immutable + #yarn bootstrap + - name: Build + run: | + # Stop eslint from failing the build + rm .eslintrc.json + yarn build + - name: Run Lighthouse audit + run: npx @lhci/cli@0.4.0 autorun diff --git a/package.json b/package.json index c0287b56d..dca9766b1 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,11 @@ "doc": "docs" }, "scripts": { + "init-project": "echo 'no-op for now'", "lint": "eslint --ext .jsx,.js deploy/www/js", "prepare-unit-test-ci": "echo 'no-op for now'", "start": "make build", + "build": "make build", "watch": "livereload ./deploy/* ./deploy/www/* ./deploy/templates/* ./deploy/lib/control/* --debug", "security-check": "yarn audit", "prettier": "npx prettier --write .", @@ -36,7 +38,7 @@ "url": "https://github.com/BitLucid/ninjawars/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=16.13.0" }, "homepage": "https://github.com/BitLucid/ninjawars#readme", "devDependencies": {