From 8fb8ac4247df49ac8a09e8c973e728f926e429f7 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Tue, 27 May 2025 15:57:10 -0400 Subject: [PATCH 1/5] rebase --- .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/pr.yml | 42 ---------------------- .gitignore | 4 +++ package-lock.json | 35 +++++++++++++++++++ package.json | 3 ++ 5 files changed, 117 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..e8b27f00 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + actions: read + +jobs: + quality: + name: Lint & Format + runs-on: ubuntu-latest + + steps: + - name: Harden Runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run linting + run: npm run lint + + - name: Check formatting + run: npm run format:check + + test: + name: Test & Coverage + runs-on: ubuntu-latest + + steps: + - name: Harden Runner + uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run tests with coverage + run: npm run test:ci + + - name: Upload coverage to Codecov + if: always() + uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2 + with: + files: ./lcov.info + + - name: Upload test results to Codecov + if: always() + uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0 + with: + files: ./junit.xml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index ae060f82..00000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: CI - -on: - push: - branches: [main] - pull_request: - branches: [main] - -permissions: - contents: read - -env: - FORCE_COLOR: 1 - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Harden Runner - uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 - with: - egress-policy: audit - - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Lint - run: node --run lint - - - name: Format - run: node --run format - - - name: Test with coverage - run: node --run test:coverage diff --git a/.gitignore b/.gitignore index ff95866d..d46bde90 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ npm-debug.log # Default Output Directory out + +# Tests +lcov.info +junit.xml diff --git a/package-lock.json b/package-lock.json index 578a6b62..8d5b9e60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ }, "devDependencies": { "@eslint/js": "^9.27.0", + "@reporters/github": "^1.7.2", "@types/mdast": "^4.0.4", "@types/node": "^22.15.3", "eslint": "^9.27.0", @@ -455,6 +456,17 @@ "dpack": "^0.6.22" } }, + "node_modules/@reporters/github": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@reporters/github/-/github-1.7.2.tgz", + "integrity": "sha512-8mvTyKUxxDXkNIWfzv3FsHVwjr8JCwVtwidQws2neV6YgrsJW6OwTOBBhd01RKrDMXPxgpMQuFEfN9hRuUZGuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@actions/core": "^1.10.0", + "stack-utils": "^2.0.6" + } + }, "node_modules/@shikijs/core": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.4.2.tgz", @@ -3691,6 +3703,29 @@ "dev": true, "license": "CC0-1.0" }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", diff --git a/package.json b/package.json index c4c6e40d..0491ba00 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,10 @@ "lint:fix": "eslint --fix . --no-warn-ignored", "format": "prettier .", "format:write": "prettier --write .", + "format:check": "prettier --check .", "test": "node --test", "test:coverage": "node --experimental-test-coverage --test", + "test:ci": "node --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=junit.xml --test-reporter=@reporters/github --test-reporter-destination=stdout --test-reporter=spec --test-reporter-destination=stdout --test", "test:update-snapshots": "node --test --test-update-snapshots", "test:watch": "node --test --watch", "prepare": "husky", @@ -23,6 +25,7 @@ }, "devDependencies": { "@eslint/js": "^9.27.0", + "@reporters/github": "^1.7.2", "@types/mdast": "^4.0.4", "@types/node": "^22.15.3", "eslint": "^9.27.0", From 443ec84a670fd8928079a42b6e837fa7add917b3 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Tue, 27 May 2025 09:26:08 -0400 Subject: [PATCH 2/5] fixup! chore(ci): improve ci --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8b27f00..5c48824d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,9 @@ on: permissions: contents: read - actions: read + +env: + FORCE_COLOR: 1 jobs: quality: @@ -27,6 +29,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: + node-version-file: '.nvmrc' cache: 'npm' - name: Install dependencies @@ -54,6 +57,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: + node-version-file: '.nvmrc' cache: 'npm' - name: Install dependencies From 115461e2dcbcaa4b351becb918d38e1e49819203 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Tue, 27 May 2025 09:55:13 -0400 Subject: [PATCH 3/5] Update ci.yml Co-authored-by: Sebastian Beltran --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c48824d..934f1a95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: run: npm ci - name: Run tests with coverage - run: npm run test:ci + run: node --run test:ci - name: Upload coverage to Codecov if: always() From d5c2529082af665261661d120f188eb00c9c4a67 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Tue, 27 May 2025 09:55:21 -0400 Subject: [PATCH 4/5] Update ci.yml Co-authored-by: Sebastian Beltran --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 934f1a95..a265ff5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: npm ci - name: Run linting - run: npm run lint + run: node --run lint - name: Check formatting run: npm run format:check From 7f02a820994ec9992f51bdc68ee52dcd1c0e38e9 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Tue, 27 May 2025 09:55:28 -0400 Subject: [PATCH 5/5] Update ci.yml Co-authored-by: Sebastian Beltran --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a265ff5e..ee565032 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: run: node --run lint - name: Check formatting - run: npm run format:check + run: node --run format:check test: name: Test & Coverage