diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9621b8b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Check out with LF on every platform. inject-markdown writes LF, so CRLF checkouts +# (Windows) would show every injected file as changed. +* text=auto eol=lf diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index a9f61cc..50a8930 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -4,7 +4,7 @@ inputs: node-version: required: false description: The version of Node to use. - default: "18.x" + default: "22.x" runs: using: "composite" steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2c87610 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,52 @@ +name: " 🧪 Test" +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +jobs: + test-node-versions: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node-version: + - 22.x + - 24.x + - 25.x + os: + - ubuntu-latest + + include: + - os: windows-latest + node-version: 24.x + + steps: + - uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + with: + node-version: ${{ matrix.node-version }} + + - run: npm ci --omit=dev + - run: npm test + + # Ensure the repository is clean after build & test + - run: git --no-pager diff --compact-summary --exit-code + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - run: npm ci + - run: npx prettier --check . diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 8a8015b..0955741 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -40,7 +40,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 18.x + node-version: 22.x - name: Update Root run: | diff --git a/.github/workflows/update-inject-markdown.yml b/.github/workflows/update-inject-markdown.yml index 1176a02..e6feb22 100644 --- a/.github/workflows/update-inject-markdown.yml +++ b/.github/workflows/update-inject-markdown.yml @@ -40,7 +40,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 18.x + node-version: 22.x - name: Install run: | diff --git a/package-lock.json b/package-lock.json index a947f4d..d2dd249 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "prettier": "^3.10.1" }, "engines": { - "node": ">=18" + "node": ">=22" } }, "node_modules/@types/debug": { diff --git a/package.json b/package.json index cf2658a..b5384f7 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "index.js" ], "engines": { - "node": ">=18" + "node": ">=22" }, "dependencies": { "inject-markdown": "^6.3.0"