From e8aff5fa880f9d82d0c31038af2ebb875d588dbf Mon Sep 17 00:00:00 2001 From: Jayc Date: Wed, 28 Apr 2021 18:14:53 +0530 Subject: [PATCH 1/7] test only --- .github/workflows/test.yml | 2 ++ src/apiCalls.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd643bc..fc937b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,8 @@ on: jobs: request: runs-on: ubuntu-latest + env: + TEST_ONLY: true steps: - uses: actions/checkout@v2 with: diff --git a/src/apiCalls.js b/src/apiCalls.js index 01e7ab3..68f9009 100644 --- a/src/apiCalls.js +++ b/src/apiCalls.js @@ -8,6 +8,9 @@ const publishEndpoint = `${serverEndpoint}/transformations/libraries/publish`; const listTransformationsEndpoint = `${serverEndpoint}/transformations`; const listLibrariesEndpoint = `${serverEndpoint}/libraries`; +const testOnly = core.getInput("TEST_ONLY"); +core.info(`env var ::: ${testOnly} ::: ${process.env}`); + async function getAllTransformations() { return axios.default.get(listTransformationsEndpoint, { auth: { From 588e0285ea9515bcbd720687775ad9a9a31ab058 Mon Sep 17 00:00:00 2001 From: Jayc Date: Wed, 28 Apr 2021 19:43:22 +0530 Subject: [PATCH 2/7] more var --- dist/index.js | 5 +++++ src/index.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dist/index.js b/dist/index.js index bc8be72..c4534b6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16150,6 +16150,7 @@ const testEndpoint = `${serverEndpoint}/transformations/libraries/test`; const publishEndpoint = `${serverEndpoint}/transformations/libraries/publish`; const listTransformationsEndpoint = `${serverEndpoint}/transformations`; const listLibrariesEndpoint = `${serverEndpoint}/libraries`; + async function getAllTransformations() { return axios.default.get(listTransformationsEndpoint, { @@ -16314,6 +16315,9 @@ const serverList = { const transformationNameToId = {}; const libraryNameToId = {}; +const testOnly = core.getInput("TEST_ONLY"); +core.info(`env var ::: ${testOnly} ::: ${process.env}`); + function getTransformationsAndLibrariesFromLocal(transformations, libraries) { core.info("metaFilePath test: " + metaFilePath); let meta = JSON.parse(fs.readFileSync(metaFilePath, "utf-8")); @@ -16323,6 +16327,7 @@ function getTransformationsAndLibrariesFromLocal(transformations, libraries) { if (meta.libraries) { libraries.push(...meta.libraries); } + core.info(`env var ::: ${testOnly} ::: ${JSON.stringify(process.env)}`); core.info(`transformations from meta: ${JSON.stringify(transformations)}`); core.info(`libraries from meta: ${JSON.stringify(libraries)}`); } diff --git a/src/index.js b/src/index.js index 0d74cbc..05816d9 100644 --- a/src/index.js +++ b/src/index.js @@ -28,6 +28,9 @@ const serverList = { const transformationNameToId = {}; const libraryNameToId = {}; +const testOnly = core.getInput("TEST_ONLY"); +core.info(`env var ::: ${testOnly} ::: ${process.env}`); + function getTransformationsAndLibrariesFromLocal(transformations, libraries) { core.info("metaFilePath test: " + metaFilePath); let meta = JSON.parse(fs.readFileSync(metaFilePath, "utf-8")); @@ -37,6 +40,7 @@ function getTransformationsAndLibrariesFromLocal(transformations, libraries) { if (meta.libraries) { libraries.push(...meta.libraries); } + core.info(`env var ::: ${testOnly} ::: ${JSON.stringify(process.env)}`); core.info(`transformations from meta: ${JSON.stringify(transformations)}`); core.info(`libraries from meta: ${JSON.stringify(libraries)}`); } From 0901669b307c672a89279d60fcbc0678d0f1daeb Mon Sep 17 00:00:00 2001 From: Jayc Date: Wed, 28 Apr 2021 19:50:27 +0530 Subject: [PATCH 3/7] condition check --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc937b2..6628558 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,8 @@ jobs: request: runs-on: ubuntu-latest env: - TEST_ONLY: true + if: ${{ github.event_name == 'pull_request' }} + TEST_ONLY: false steps: - uses: actions/checkout@v2 with: From c34086e3d790596bd05b9bb7eaf8b3cdd6c2b2aa Mon Sep 17 00:00:00 2001 From: Jayc Date: Wed, 28 Apr 2021 20:03:59 +0530 Subject: [PATCH 4/7] var dec --- .github/workflows/test.yml | 3 +-- dist/index.js | 12 +++++++----- src/apiCalls.js | 3 --- src/index.js | 11 +++++++---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6628558..6e4fa3a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,8 +12,7 @@ jobs: request: runs-on: ubuntu-latest env: - if: ${{ github.event_name == 'pull_request' }} - TEST_ONLY: false + TEST_ONLY: ${{ github.event_name == 'pull_request' }} steps: - uses: actions/checkout@v2 with: diff --git a/dist/index.js b/dist/index.js index c4534b6..59e36b9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16150,7 +16150,6 @@ const testEndpoint = `${serverEndpoint}/transformations/libraries/test`; const publishEndpoint = `${serverEndpoint}/transformations/libraries/publish`; const listTransformationsEndpoint = `${serverEndpoint}/transformations`; const listLibrariesEndpoint = `${serverEndpoint}/libraries`; - async function getAllTransformations() { return axios.default.get(listTransformationsEndpoint, { @@ -16315,8 +16314,8 @@ const serverList = { const transformationNameToId = {}; const libraryNameToId = {}; -const testOnly = core.getInput("TEST_ONLY"); -core.info(`env var ::: ${testOnly} ::: ${process.env}`); +const testOnly = (process.env.TEST_ONLY == 'true'); +core.info(`env var ::: ${testOnly} ::: ${process.env.TEST_ONLY}`); function getTransformationsAndLibrariesFromLocal(transformations, libraries) { core.info("metaFilePath test: " + metaFilePath); @@ -16526,8 +16525,11 @@ async function testAndPublish() { core.info("Test Passed!!!"); // publish - res = await publish(transformationTest, librariesTest); - core.info(`Publish result: ${JSON.stringify(res.data)}`); + if (!testOnly) { + res = await publish(transformationTest, librariesTest); + core.info(`Publish result: ${JSON.stringify(res.data)}`); + } + } catch (err) { if (err.response) { core.error(err.response.data); diff --git a/src/apiCalls.js b/src/apiCalls.js index 68f9009..01e7ab3 100644 --- a/src/apiCalls.js +++ b/src/apiCalls.js @@ -8,9 +8,6 @@ const publishEndpoint = `${serverEndpoint}/transformations/libraries/publish`; const listTransformationsEndpoint = `${serverEndpoint}/transformations`; const listLibrariesEndpoint = `${serverEndpoint}/libraries`; -const testOnly = core.getInput("TEST_ONLY"); -core.info(`env var ::: ${testOnly} ::: ${process.env}`); - async function getAllTransformations() { return axios.default.get(listTransformationsEndpoint, { auth: { diff --git a/src/index.js b/src/index.js index 05816d9..5c80e0f 100644 --- a/src/index.js +++ b/src/index.js @@ -28,8 +28,8 @@ const serverList = { const transformationNameToId = {}; const libraryNameToId = {}; -const testOnly = core.getInput("TEST_ONLY"); -core.info(`env var ::: ${testOnly} ::: ${process.env}`); +const testOnly = (process.env.TEST_ONLY == 'true'); +core.info(`env var ::: ${testOnly} ::: ${process.env.TEST_ONLY}`); function getTransformationsAndLibrariesFromLocal(transformations, libraries) { core.info("metaFilePath test: " + metaFilePath); @@ -239,8 +239,11 @@ async function testAndPublish() { core.info("Test Passed!!!"); // publish - res = await publish(transformationTest, librariesTest); - core.info(`Publish result: ${JSON.stringify(res.data)}`); + if (!testOnly) { + res = await publish(transformationTest, librariesTest); + core.info(`Publish result: ${JSON.stringify(res.data)}`); + } + } catch (err) { if (err.response) { core.error(err.response.data); From 15ca0e30408cb635b849242f3416de6828a5b815 Mon Sep 17 00:00:00 2001 From: Jayc Date: Wed, 28 Apr 2021 20:06:08 +0530 Subject: [PATCH 5/7] test bool --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e4fa3a..457e9e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: request: runs-on: ubuntu-latest env: - TEST_ONLY: ${{ github.event_name == 'pull_request' }} + TEST_ONLY: ${{ github.event_name == 'push' }} steps: - uses: actions/checkout@v2 with: From 18f6e11e236863ea3bc25c2fbb98722638148996 Mon Sep 17 00:00:00 2001 From: Jayc Date: Thu, 29 Apr 2021 18:35:00 +0530 Subject: [PATCH 6/7] clean logs --- dist/index.js | 4 ---- src/index.js | 4 ---- 2 files changed, 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 59e36b9..4b7cd80 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16315,7 +16315,6 @@ const transformationNameToId = {}; const libraryNameToId = {}; const testOnly = (process.env.TEST_ONLY == 'true'); -core.info(`env var ::: ${testOnly} ::: ${process.env.TEST_ONLY}`); function getTransformationsAndLibrariesFromLocal(transformations, libraries) { core.info("metaFilePath test: " + metaFilePath); @@ -16326,9 +16325,6 @@ function getTransformationsAndLibrariesFromLocal(transformations, libraries) { if (meta.libraries) { libraries.push(...meta.libraries); } - core.info(`env var ::: ${testOnly} ::: ${JSON.stringify(process.env)}`); - core.info(`transformations from meta: ${JSON.stringify(transformations)}`); - core.info(`libraries from meta: ${JSON.stringify(libraries)}`); } function buildNametoIdMap(objectArr, type) { diff --git a/src/index.js b/src/index.js index 5c80e0f..71eba1c 100644 --- a/src/index.js +++ b/src/index.js @@ -29,7 +29,6 @@ const transformationNameToId = {}; const libraryNameToId = {}; const testOnly = (process.env.TEST_ONLY == 'true'); -core.info(`env var ::: ${testOnly} ::: ${process.env.TEST_ONLY}`); function getTransformationsAndLibrariesFromLocal(transformations, libraries) { core.info("metaFilePath test: " + metaFilePath); @@ -40,9 +39,6 @@ function getTransformationsAndLibrariesFromLocal(transformations, libraries) { if (meta.libraries) { libraries.push(...meta.libraries); } - core.info(`env var ::: ${testOnly} ::: ${JSON.stringify(process.env)}`); - core.info(`transformations from meta: ${JSON.stringify(transformations)}`); - core.info(`libraries from meta: ${JSON.stringify(libraries)}`); } function buildNametoIdMap(objectArr, type) { From f5d7b84100ffab30af1c51a314a130f2a8b9eeca Mon Sep 17 00:00:00 2001 From: Jayc Date: Thu, 29 Apr 2021 18:38:29 +0530 Subject: [PATCH 7/7] true if not push --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 457e9e9..78b1ff9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: request: runs-on: ubuntu-latest env: - TEST_ONLY: ${{ github.event_name == 'push' }} + TEST_ONLY: ${{ github.event_name != 'push' }} steps: - uses: actions/checkout@v2 with: