Unverified Commit 65b8989f authored by Yang Cao's avatar Yang Cao Committed by GitHub
Browse files

Merge pull request #1284 from takost/update-to-node-20

Update action to node20
parents e12d46a6 d0be34d5
Loading
Loading
Loading
Loading
+2
Changes for .github/workflows/check-dist.yml: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -15,3 +15,5 @@ jobs:
  call-check-dist:
    name: Check dist/
    uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
    with:
      node-version: "20.x"
+2 −2
Changes for .github/workflows/workflow.yml: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -21,10 +21,10 @@ jobs:
    steps:
    - name: Checkout
      uses: actions/checkout@v3
    - name: Setup Node.js 16.x
    - name: Setup Node.js 20.x
      uses: actions/setup-node@v3
      with:
        node-version: 16.x
        node-version: 20.x
        cache: npm
    - run: npm ci
    - name: Prettier Format Check
+4
Changes for RELEASES.md: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -116,3 +116,7 @@

- Updates @actions/cache to v3.2.3 to fix accidental mutated path arguments to `getCacheVersion` [actions/toolkit#1378](https://github.com/actions/toolkit/pull/1378)
- Additional audit fixes of npm package(s)

### 4.0.0

- Updated minimum runner version support from node 12 -> node 20
+2 −2
Changes for __tests__/save.test.ts: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ import * as cache from "@actions/cache";
import * as core from "@actions/core";

import { Events, Inputs, RefKey } from "../src/constants";
import run from "../src/save";
import { saveRun } from "../src/saveImpl";
import * as actionUtils from "../src/utils/actionUtils";
import * as testUtils from "../src/utils/testUtils";

@@ -100,7 +100,7 @@ test("save with valid inputs uploads a cache", async () => {
            return Promise.resolve(cacheId);
        });

    await run();
    await saveRun();

    expect(saveCacheMock).toHaveBeenCalledTimes(1);
    expect(saveCacheMock).toHaveBeenCalledWith(
+12 −12
Changes for __tests__/saveImpl.test.ts: 12 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ import * as cache from "@actions/cache";
import * as core from "@actions/core";

import { Events, Inputs, RefKey } from "../src/constants";
import run from "../src/saveImpl";
import { saveImpl } from "../src/saveImpl";
import { StateProvider } from "../src/stateProvider";
import * as actionUtils from "../src/utils/actionUtils";
import * as testUtils from "../src/utils/testUtils";
@@ -77,7 +77,7 @@ test("save with invalid event outputs warning", async () => {
    const invalidEvent = "commit_comment";
    process.env[Events.Key] = invalidEvent;
    delete process.env[RefKey];
    await run(new StateProvider());
    await saveImpl(new StateProvider());
    expect(logWarningMock).toHaveBeenCalledWith(
        `Event Validation Error: The event type ${invalidEvent} is not supported because it's not tied to a branch or tag ref.`
    );
@@ -100,7 +100,7 @@ test("save with no primary key in state outputs warning", async () => {
        });
    const saveCacheMock = jest.spyOn(cache, "saveCache");

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(0);
    expect(logWarningMock).toHaveBeenCalledWith(`Key is not specified.`);
@@ -115,7 +115,7 @@ test("save without AC available should no-op", async () => {

    const saveCacheMock = jest.spyOn(cache, "saveCache");

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(0);
});
@@ -128,7 +128,7 @@ test("save on ghes without AC available should no-op", async () => {

    const saveCacheMock = jest.spyOn(cache, "saveCache");

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(0);
});
@@ -161,7 +161,7 @@ test("save on GHES with AC available", async () => {
            return Promise.resolve(cacheId);
        });

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(1);
    expect(saveCacheMock).toHaveBeenCalledWith(
@@ -194,7 +194,7 @@ test("save with exact match returns early", async () => {
        });
    const saveCacheMock = jest.spyOn(cache, "saveCache");

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(0);
    expect(infoMock).toHaveBeenCalledWith(
@@ -221,7 +221,7 @@ test("save with missing input outputs warning", async () => {
        });
    const saveCacheMock = jest.spyOn(cache, "saveCache");

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(0);
    expect(logWarningMock).toHaveBeenCalledWith(
@@ -259,7 +259,7 @@ test("save with large cache outputs warning", async () => {
            );
        });

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(1);
    expect(saveCacheMock).toHaveBeenCalledWith(
@@ -306,7 +306,7 @@ test("save with reserve cache failure outputs warning", async () => {
            throw error;
        });

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(1);
    expect(saveCacheMock).toHaveBeenCalledWith(
@@ -349,7 +349,7 @@ test("save with server error outputs warning", async () => {
            throw new Error("HTTP Error Occurred");
        });

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(1);
    expect(saveCacheMock).toHaveBeenCalledWith(
@@ -392,7 +392,7 @@ test("save with valid inputs uploads a cache", async () => {
            return Promise.resolve(cacheId);
        });

    await run(new StateProvider());
    await saveImpl(new StateProvider());

    expect(saveCacheMock).toHaveBeenCalledTimes(1);
    expect(saveCacheMock).toHaveBeenCalledWith(
Loading