Skip to content

Commit 04a84c9

Browse files
Merge pull request #18 from stackql/fix/demo-issue
use github action path
2 parents ee425f6 + 155f662 commit 04a84c9

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

.github/workflows/stackql-assert.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,35 @@ jobs:
4040
auth_obj_path: './.github/workflows/workflow_scripts/auth.json'
4141
test_query: |
4242
REGISTRY PULL google v23.01.00116;
43-
SELECT name, status
43+
SELECT name
4444
FROM google.compute.instances
4545
WHERE project = 'stackql-demo' AND zone = 'australia-southeast1-a' AND name = 'stackql-demo-001';
46-
expected_results_str: ' [{"name":"stackql-demo-001","status":"TERMINATED"}]'
46+
expected_results_str: ' [{"name":"stackql-demo-001"}]'
4747

4848
- name: Use test query file and expected result string with auth object
4949
uses: ./
5050
with:
5151
auth_obj_path: './.github/workflows/workflow_scripts/auth.json'
5252
test_query_file_path: './.github/workflows/workflow_scripts/google-example.iql'
53-
expected_results_str: ' [{"name":"stackql-demo-001","status":"TERMINATED"}]'
53+
expected_results_str: ' [{"name":"stackql-demo-001"}]'
5454

5555
- name: Use test query string and expected results string, with auth string
5656
uses: ./
5757
with:
5858
auth_str: '{ "google": { "type": "service_account", "credentialsfilepath": "sa-key.json" }}'
5959
test_query: |
6060
REGISTRY PULL google v23.01.00116;
61-
SELECT name, status
61+
SELECT name
6262
FROM google.compute.instances
6363
WHERE project = 'stackql-demo' AND zone = 'australia-southeast1-a' AND name = 'stackql-demo-001';
64-
expected_results_str: '[{"name":"stackql-demo-001","status":"TERMINATED"}]'
64+
expected_results_str: '[{"name":"stackql-demo-001"}]'
6565

6666
- name: Use test query string and expected results file, with auth object
6767
uses: ./
6868
with:
6969
auth_obj_path: './.github/workflows/workflow_scripts/auth.json'
7070
test_query_file_path: './.github/workflows/workflow_scripts/google-example.iql'
71-
expected_results_str: '[{"name":"stackql-demo-001","status":"TERMINATED"}]'
71+
expected_results_str: '[{"name":"stackql-demo-001"}]'
7272

7373
- name: Use test query string and expected rows, with auth object
7474
uses: ./
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"name":"stackql-demo-001","status":"TERMINATED"}]
1+
[{"name":"stackql-demo-001"}]
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
REGISTRY PULL google v23.01.00116;
2-
SELECT name, status
2+
SELECT name
33
FROM google.compute.instances
44
WHERE project = 'stackql-demo' AND zone = 'australia-southeast1-a' AND name = 'stackql-demo-001';

action.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ runs:
4949
uses: actions/github-script@v6
5050
with:
5151
script: |
52-
const {setupAuth} = require('./lib/utils.js')
52+
const path = require('path');
53+
const utilsPath = path.join(process.env.GITHUB_ACTION_PATH, 'lib', 'utils.js')
54+
const {setupAuth} = require(utilsPath)
5355
setupAuth(core)
5456
env:
5557
AUTH_FILE_PATH: ${{ inputs.auth_obj_path }}
@@ -59,7 +61,9 @@ runs:
5961
uses: actions/github-script@v6
6062
with:
6163
script: |
62-
const {getStackqlCommand} = require('./lib/utils.js')
64+
const path = require('path');
65+
const utilsPath = path.join(process.env.GITHUB_ACTION_PATH, 'lib', 'utils.js')
66+
const {getStackqlCommand} = require(utilsPath)
6367
getStackqlCommand(core)
6468
env:
6569
QUERY_FILE_PATH: ${{ inputs.test_query_file_path }}
@@ -76,7 +80,9 @@ runs:
7680
uses: actions/github-script@v6
7781
with:
7882
script: |
79-
const {assertResult} = require('./stackql-assert.js')
83+
const path = require('path');
84+
const assertPath = path.join(process.env.GITHUB_ACTION_PATH, 'stackql-assert.js')
85+
const {assertResult} = require(assertPath)
8086
assertResult(core)
8187
env:
8288
RESULT: ${{steps.exec-query.outputs.stdout}}

0 commit comments

Comments
 (0)