Browse Source

[CI] bumping actions/cache to v3 to fix ci error (#10345)

* bumping actions/cache to v3

* fix JSONUtilsTest.java unit test error
3.1.0-release
xiangzihao 3 years ago committed by GitHub
parent
commit
50e9f2916a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/backend.yml
  2. 4
      .github/workflows/e2e.yml
  3. 2
      .github/workflows/publish-docker.yaml
  4. 2
      .github/workflows/py-ci.yml
  5. 2
      .github/workflows/unit-test.yml
  6. 4
      dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/JSONUtilsTest.java

2
.github/workflows/backend.yml

@ -63,7 +63,7 @@ jobs:
submodules: true submodules: true
- name: Sanity Check - name: Sanity Check
uses: ./.github/actions/sanity-check uses: ./.github/actions/sanity-check
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven key: ${{ runner.os }}-maven

4
.github/workflows/e2e.yml

@ -55,7 +55,7 @@ jobs:
- name: Sanity Check - name: Sanity Check
uses: ./.github/actions/sanity-check uses: ./.github/actions/sanity-check
- name: Cache local Maven repository - name: Cache local Maven repository
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@ -127,7 +127,7 @@ jobs:
with: with:
submodules: true submodules: true
- name: Cache local Maven repository - name: Cache local Maven repository
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

2
.github/workflows/publish-docker.yaml

@ -35,7 +35,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Cache local Maven repository - name: Cache local Maven repository
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

2
.github/workflows/py-ci.yml

@ -127,7 +127,7 @@ jobs:
- name: Sanity Check - name: Sanity Check
uses: ./.github/actions/sanity-check uses: ./.github/actions/sanity-check
- name: Cache local Maven repository - name: Cache local Maven repository
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

2
.github/workflows/unit-test.yml

@ -65,7 +65,7 @@ jobs:
with: with:
java-version: 8 java-version: 8
distribution: 'adopt' distribution: 'adopt'
- uses: actions/cache@v2 - uses: actions/cache@v3
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven key: ${{ runner.os }}-maven

4
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/JSONUtilsTest.java

@ -262,7 +262,7 @@ public class JSONUtilsTest {
@Test @Test
public void dateToString() { public void dateToString() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai")); TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
String time = "2022-02-22 13:38:24"; String time = "2022-02-22 13:38:24";
Date date = DateUtils.stringToDate(time); Date date = DateUtils.stringToDate(time);
String json = JSONUtils.toJsonString(date); String json = JSONUtils.toJsonString(date);
@ -274,7 +274,7 @@ public class JSONUtilsTest {
@Test @Test
public void stringToDate() { public void stringToDate() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai")); TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
String json = "\"2022-02-22 13:38:24\""; String json = "\"2022-02-22 13:38:24\"";
Date date = JSONUtils.parseObject(json, Date.class); Date date = JSONUtils.parseObject(json, Date.class);
Assert.assertEquals(date, DateUtils.stringToDate("2022-02-22 13:38:24")); Assert.assertEquals(date, DateUtils.stringToDate("2022-02-22 13:38:24"));

Loading…
Cancel
Save