Skip to content

Commit 5b4955d

Browse files
ci-testing-md-files
Summary: - Support for simple testing of walkthroughs written in markdown, with annotations.
1 parent cfe5327 commit 5b4955d

File tree

3 files changed

+55
-53
lines changed

3 files changed

+55
-53
lines changed

.github/workflows/scenario.yaml

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,65 @@ on:
66
- 'scenario*'
77

88
env:
9-
GH_ACCESS_TOKEN: ${{ secrets.ACTIONS_PRIVATE_PACKAGE_SECRET }}
9+
TAG_NAME: ${{ github.ref_name }}
1010

1111
jobs:
1212
scenario-testing:
1313
runs-on: ubuntu-latest
14+
timeout-minutes: ${{ vars.DEFAULT_JOB_TIMEOUT_MIN == '' && 120 || vars.DEFAULT_JOB_TIMEOUT_MIN }}
1415
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
- name: Setup Go
20-
uses: actions/setup-go@v4
21-
with:
22-
go-version: ^1.19
23-
- name: Install cross-compiler for linux/arm64
24-
run: sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
25-
- name: Run Goreleaser
26-
uses: goreleaser/goreleaser-action@v5
27-
with:
28-
version: latest
29-
args: release --clean --config .github/goreleaser/.goreleaser-for-linux.yaml --verbose
30-
env:
31-
GITHUB_TOKEN: ${{env.GH_ACCESS_TOKEN}}
16+
- name: Ref Parse
17+
run: |
18+
{
19+
echo "runID=$(echo -n '${{ github.ref_name }}' | cut -d '-' -f 2)"
20+
} >> "${GITHUB_ENV}"
3221
33-
build-macos-binary:
34-
runs-on: macos-latest
35-
steps:
36-
- name: Checkout
37-
uses: actions/checkout@v4
38-
with:
39-
fetch-depth: 0
40-
- name: Setup Go
41-
uses: actions/setup-go@v4
42-
with:
43-
go-version: ^1.19
44-
- name: Run Goreleaser
45-
uses: goreleaser/goreleaser-action@v5
46-
with:
47-
version: latest
48-
args: release --clean --config .github/goreleaser/.goreleaser-for-darwin.yaml --verbose
49-
env:
50-
GITHUB_TOKEN: ${{env.GH_ACCESS_TOKEN}}
22+
- name: Check out code into the Go module directory
23+
uses: actions/[email protected]
5124

52-
build-windows-binary:
53-
runs-on: windows-latest
54-
steps:
55-
- name: Checkout
56-
uses: actions/checkout@v4
57-
with:
58-
fetch-depth: 0
59-
- name: Setup Go
60-
uses: actions/setup-go@v4
61-
with:
62-
go-version: ^1.19
63-
- name: Run Goreleaser
64-
uses: goreleaser/goreleaser-action@v5
25+
- name: Download Artifact
26+
uses: actions/[email protected]
6527
with:
66-
version: latest
67-
args: release --clean --config .github/goreleaser/.goreleaser-for-windows.yaml --verbose
28+
name: stackql_linux_amd64
29+
path: build
30+
github-token: ${{ secrets.CI_STACKQL_PACKAGE_DOWNLOAD_TOKEN }}
31+
run-id: ${{ env.runID }}
32+
33+
- name: Stackql permissions
34+
run: |
35+
sudo chmod a+rwx build/stackql
36+
ls -al build/stackql
37+
{
38+
echo "PATH=$PATH:$(pwd)/build/stackql"
39+
} >> "${GITHUB_ENV}"
40+
41+
- name: Check Stackql Version
42+
run: |
43+
stackql --version
44+
45+
- name: Persist secrets
46+
run: |
47+
echo "$GCP_RO_SECRET" >> cicd/keys/testing/google-ro-credentials.json
48+
shell: bash
6849
env:
69-
GITHUB_TOKEN: ${{env.GH_ACCESS_TOKEN}}
50+
GCP_RO_SECRET: ${{ secrets.CI_SCENARIO_GCP_RO_SECRET }}
51+
52+
- name: Install Python dependencies
53+
run: |
54+
pip3 install -r cicd/requirements.txt
55+
56+
- name: Run Walkthrough Scenarios
57+
run: |
58+
python3 test/python/markdown_testing/markdown_testing.py 2>&1 | tee cicd/log/markdown-testing-results.log
59+
60+
- name: Upload Test Results
61+
uses: actions/[email protected]
62+
with:
63+
name: scenario_test_results
64+
path: cicd/log/markdown-testing-results.log
65+
66+
- name: Cleanup
67+
if: always()
68+
run: |
69+
rm -rf cicd/keys/testing
70+

cicd/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Flask==3.0.3
2+
mistune==3.0.2
23
psycopg2-binary>=2.9.9
34
psycopg[binary]>=3.1.16
45
PyYaml>=6.0.1

docs/walkthroughs/get-google-vms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ First, create a google service account key using the GCP Console, per [the GCP d
55

66
Then, do this in bash:
77

8-
```bash setup stackql-shell credentials-path=cicd/keys/testing/google-credentials.json app-root-path=./test/tmp/.get-google-vms.stackql
8+
```bash setup stackql-shell credentials-path=cicd/keys/testing/google-ro-credentials.json app-root-path=./test/tmp/.get-google-vms.stackql
99

1010
export GOOGLE_CREDENTIALS="$(cat <credentials-path>)";
1111

0 commit comments

Comments
 (0)