Skip to content

Commit 7918b68

Browse files
authored
Merge pull request #8 from stackql/develop-updates
Develop updates
2 parents 7ba7c98 + 65b92f3 commit 7918b68

9 files changed

Lines changed: 417 additions & 375 deletions

File tree

.github/workflows/example-workflows.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: 'Setup StackQL'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'develop-**'
8+
pull_request:
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
stackql-tests-linux:
16+
name: 'Stackql Tests (Linux)'
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Setup stackql
24+
uses: ./
25+
26+
- name: Validate Stackql Version
27+
run: |
28+
stackql --version
29+
30+
- name: Use GitHub Provider
31+
run: |
32+
stackql exec -i ./examples/github-example.iql --auth="${AUTH}"
33+
env:
34+
AUTH: ${{ vars.AUTH }} ##'{ "github": { "type": "basic", "credentialsenvvar": "STACKQL_GITHUB_CREDS" } }'
35+
STACKQL_GITHUB_CREDS: ${{ secrets.STACKQL_GITHUB_CREDS }}
36+
37+
- name: Use Google Provider
38+
run: | ## use the secret to create json file
39+
sudo echo ${{ secrets.GOOGLE_CREDS }} | base64 -d > sa-key.json
40+
stackql exec -i ./examples/google-example.iql --auth="${AUTH}"
41+
env:
42+
AUTH: ${{ vars.AUTH }} ## '{ "google": { "type": "service_account", "credentialsfilepath": "sa-key.json" }}'
43+
44+
##### uncomment the step to see error handling
45+
# - name: Handle error
46+
# run: | ## use the secret to create json file
47+
# stackql exec -i ./examples/github-example.iql --auth="${INVALID_AUTH}"
48+
49+
stackql-tests-mac:
50+
name: 'Stackql Tests (MacOS)'
51+
runs-on: macos-latest
52+
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v3
56+
57+
- name: Setup stackql
58+
uses: ./
59+
60+
- name: Validate Stackql Version
61+
run: |
62+
stackql --version
63+
64+
- name: Use GitHub Provider
65+
run: |
66+
stackql exec -i ./examples/github-example.iql --auth="${AUTH}"
67+
env:
68+
AUTH: ${{ vars.AUTH }} ##'{ "github": { "type": "basic", "credentialsenvvar": "STACKQL_GITHUB_CREDS" } }'
69+
STACKQL_GITHUB_CREDS: ${{ secrets.STACKQL_GITHUB_CREDS }}
70+
71+
- name: Use Google Provider
72+
run: | ## use the secret to create json file
73+
sudo echo ${{ secrets.GOOGLE_CREDS }} | base64 -d > sa-key.json
74+
stackql exec -i ./examples/google-example.iql --auth="${AUTH}"
75+
env:
76+
AUTH: ${{ vars.AUTH }} ## '{ "google": { "type": "service_account", "credentialsfilepath": "sa-key.json" }}'
77+
78+
stackql-tests-windows:
79+
name: 'Stackql Tests (Windows)'
80+
runs-on: windows-latest
81+
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v3
85+
86+
- name: Setup stackql
87+
uses: ./
88+
89+
- name: Validate Stackql Version
90+
run: |
91+
stackql --version
92+
93+
- name: Use GitHub Provider
94+
run: |
95+
stackql exec -i ./examples/github-example.iql --auth="${AUTH}"
96+
env:
97+
AUTH: ${{ vars.AUTH }} ##'{ "github": { "type": "basic", "credentialsenvvar": "STACKQL_GITHUB_CREDS" } }'
98+
STACKQL_GITHUB_CREDS: ${{ secrets.STACKQL_GITHUB_CREDS }}
99+
100+
- name: Use Google Provider
101+
env:
102+
GOOGLE_CREDS_ENV: ${{ secrets.GOOGLE_CREDS }}
103+
AUTH: ${{ vars.AUTH }} ## '{ "google": { "type": "service_account", "credentialsfilepath": "sa-key.json" }}'
104+
shell: pwsh
105+
run: | ## use the secret to create json file
106+
$GoogleCreds = [System.Environment]::GetEnvironmentVariable("GOOGLE_CREDS_ENV")
107+
$bytes = [System.Text.Encoding]::UTF8.GetBytes($GoogleCreds)
108+
$base64 = [System.Convert]::ToBase64String($bytes)
109+
Write-Output $base64 | Set-Content sa-key.json
110+
stackql exec -i ./examples/google-example.iql --auth="${AUTH}"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
[![Setup StackQL](https://github.com/stackql/setup-stackql/actions/workflows/setup-stackql.yml/badge.svg)](https://github.com/stackql/setup-stackql/actions/workflows/setup-stackql.yml)
2+
13
# setup-stackql
24

35
The `stackql/setup-stackql` action is a JavaScript action that sets up StackQL CLI in your GitHub Actions workflow by:
46

57
- Downloading a latest Stackql CLI and adding it to the `PATH`.
68
- Setup AUTH env var in the Github Action
79

10+
This action can be run on `ubuntu-latest`, `windows-latest`, and `macos-latest` GitHub Actions runners, and will install and expose the latest version of the `stackql` CLI on the runner environment.
11+
812
# Auth
913
[Learn more](https://stackql.io/docs/getting-started/authenticating) about authentication setup when running stackql
1014

action.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
name: 'StackQL Studio - Setup StackQL'
2-
description: 'Sets up StackQL CLI in your GitHub Actions workflow.'
3-
author: 'Yuncheng Yang, StackQL'
4-
inputs:
5-
use_wrapper:
6-
description: 'Whether or not to install a wrapper to wrap subsequent calls of the `stackql` binary and expose its STDOUT, STDERR, and exit code as outputs named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `true`.'
7-
default: 'true'
8-
required: false
9-
2+
description: 'Sets up the StackQL CLI in your GitHub Actions workflow.'
3+
author: 'Yuncheng Yang, StackQL Studios'
4+
inputs: {}
5+
# use_wrapper:
6+
# description: 'Whether or not to install a wrapper to wrap subsequent calls of the `stackql` binary and expose its STDOUT, STDERR, and exit code as outputs named `stdout`, `stderr`, and `exitcode` respectively. Defaults to `true`.'
7+
# default: 'true'
8+
# required: false
109
runs:
1110
using: 'node16'
1211
main: 'dist/index.js'
1312
branding:
1413
icon: 'terminal'
15-
color: 'purple'
14+
color: 'green'

0 commit comments

Comments
 (0)