From 9afbc22571e1686dedb4eab91a226118c673a15d Mon Sep 17 00:00:00 2001 From: scagood <2230835+scagood@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:02:19 +0000 Subject: [PATCH] ci: Attempt to add test results as annotations --- .github/workflows/CI.yml | 14 ++++++++++++++ package.json | 3 +++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fb9d73c5..7fb7f238 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,6 +27,20 @@ jobs: - name: Lint run: npm run -s lint + test-report: + name: Test - With Report + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - uses: actions/setup-node@v4 + with: + node-version: latest + - run: npm install + - run: npm run -s test:ci:gha + test: name: Test diff --git a/package.json b/package.json index c54ef53a..72058a8b 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "devDependencies": { "@eslint/js": "^8.43.0", "@types/eslint": "^8.56.2", + "@types/node": "^20.11.17", "@typescript-eslint/parser": "^6.0.0", "eslint": "^8", "eslint-config-prettier": "^9.1.0", @@ -39,6 +40,7 @@ "lint-staged": "^15.2.0", "markdownlint-cli": "^0.39.0", "mocha": "^10.2.0", + "mocha-reporter-gha": "^1.1.1", "npm-run-all2": "^6.1.1", "nyc": "^15.1.0", "opener": "^1.5.2", @@ -65,6 +67,7 @@ "test": "nyc npm run -s test:_mocha", "test:_mocha": "_mocha \"tests/lib/**/*.js\" --reporter progress --timeout 4000", "test:ci": "nyc npm run -s test:_mocha", + "test:ci:gha": "_mocha \"tests/lib/**/*.js\" --reporter mocha-reporter-gha --timeout 4000", "update:eslint-docs": "eslint-doc-generator", "version": "npm run -s build && eslint lib/rules --fix && git add .", "watch": "npm run test:_mocha -- --watch --growl"