Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/10-test-quick-EXPERIMENTAL.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "10 - Test: Quick Checks (EXPERIMENTAL)"

# This is an EXPERIMENTAL workflow for testing the tiered CI approach
# It only runs on test/** branches to avoid interfering with production CI
#
# Goal: Provide fast feedback (< 2 minutes) on every commit
# What: Runs only quick unit tests using -short flag

on:
pull_request:
# Run on EVERY PR push - this is Tier 1 for fast feedback
push:
branches:
- develop
- main
workflow_dispatch:
inputs:
debug_mode:
description: 'Enable debug logging'
type: boolean
default: false

env:
STEAMPIPE_UPDATE_CHECK: false
GOTOOLCHAIN: local

jobs:
quick_tests:
name: Quick Unit Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
path: steampipe

- name: Checkout Pipe Fittings Components repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: turbot/pipe-fittings
path: pipe-fittings
ref: v1.6.x

- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: 1.24

- name: Go Cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('steampipe/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Run Quick Tests
run: |
cd steampipe
echo "πŸš€ Running quick unit tests with -short flag"
echo "This should complete in < 2 minutes"
go clean -testcache
go test -short -timeout 30s ./... -test.v
env:
STEAMPIPE_UPDATE_CHECK: false

- name: Test Results
if: always()
run: |
echo "βœ… Quick tests completed"
echo "See job logs above for detailed results"
223 changes: 223 additions & 0 deletions .github/workflows/11-test-full-EXPERIMENTAL.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
name: "11 - Test: Full Suite (EXPERIMENTAL)"

# This is an EXPERIMENTAL workflow for testing the tiered CI approach
# Only runs on manual trigger to test the full acceptance suite
#
# Goal: Run complete test suite (< 20 minutes) before merge to develop
# What: All 21 acceptance tests

on:
push:
branches:
- develop
# Run full suite after merge to develop - Tier 3 complete coverage
pull_request:
types: [labeled]
# Run if PR has "test:full" label
workflow_dispatch:
inputs:
test_mode:
description: 'Test mode'
type: choice
options:
- full
- verbose
default: 'full'

env:
STEAMPIPE_UPDATE_CHECK: false
SPIPETOOLS_PG_CONN_STRING: ${{ secrets.SPIPETOOLS_PG_CONN_STRING }}
SPIPETOOLS_TOKEN: ${{ secrets.SPIPETOOLS_TOKEN }}
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
STEAMPIPE_LOG: info

jobs:
goreleaser:
name: Build
runs-on: ubuntu-latest
# Skip if PR is labeled but doesn't have "test:full" label
if: |
github.event_name != 'pull_request' ||
github.event.action != 'labeled' ||
github.event.label.name == 'test:full'
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
path: steampipe

- name: Checkout Pipe Fittings Components repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: turbot/pipe-fittings
path: pipe-fittings
ref: v1.6.x

- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: 1.24

- name: Fetching Go Cache Paths
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT

- name: Go Build Cache
id: build-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}

- name: Run CLI Unit Tests
run: |
cd steampipe
echo "πŸ§ͺ Running all unit tests"
go clean -testcache
go test -timeout 2m ./... -test.v

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
install-only: true

- name: Run GoReleaser
run: |
cd steampipe
goreleaser release --clean --snapshot --parallelism 2 --config=.acceptance.goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Move build artifacts
run: |
mkdir ~/artifacts
mv $GITHUB_WORKSPACE/steampipe/dist/steampipe_linux_amd64.tar.gz ~/artifacts/linux.tar.gz

- name: List Build Artifacts
run: ls -l ~/artifacts

- name: Save Linux Build Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: build-artifact-linux-full
path: ~/artifacts/linux.tar.gz
if-no-files-found: error
overwrite: true

acceptance_test:
name: Test
needs: goreleaser
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
# ALL 21 acceptance tests
test_block:
- "migration"
- "brew"
- "installation"
- "plugin"
- "connection_config"
- "service"
- "settings"
- "ssl"
- "blank_aggregators"
- "search_path"
- "chaos_and_query"
- "dynamic_schema"
- "dynamic_aggregators"
- "cache"
- "performance"
- "config_precedence"
- "cloud"
- "snapshot"
- "schema_cloning"
- "exit_codes"
- "force_stop"
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: true

- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: 1.24

- name: Prepare for downloads
run: mkdir ~/artifacts

- name: Download Linux Build Artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: build-artifact-linux-full
path: ~/artifacts

- name: Extract Linux Artifacts and Install Binary
run: |
mkdir ~/build
tar -xf ~/artifacts/linux.tar.gz -C ~/build

- name: Set PATH
run: |
echo "PATH=$PATH:$HOME/build:$GITHUB_WORKSPACE/tests/acceptance/lib/bats-core/libexec" >> $GITHUB_ENV

- name: Go install jd
run: go install github.com/josephburnett/jd@latest

- name: Install DB
id: install-db
continue-on-error: false
run: |
STEAMPIPE_LOG_LEVEL=trace steampipe query "select 1"
steampipe plugin install chaos chaosdynamic --progress=false

- name: Save Install DB Logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: install-db-logs-${{ matrix.test_block }}-full
path: ~/.steampipe/logs
if-no-files-found: error

- name: Run Test Suite
id: run-test-suite
timeout-minutes: 15
continue-on-error: true
run: |
chmod +x $GITHUB_WORKSPACE/tests/acceptance/run.sh
$GITHUB_WORKSPACE/tests/acceptance/run.sh ${{ matrix.test_block }}.bats
echo "exit_code=$(echo $?)" >> $GITHUB_OUTPUT

- name: Save Test Suite Logs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-logs-${{ matrix.test_block }}-full
path: ~/.steampipe/logs
if-no-files-found: error

- name: Check Test Passed/Failed
if: ${{ success() }}
continue-on-error: false
run: |
if [ ${{ steps.run-test-suite.outputs.exit_code }} -eq 0 ]; then
exit 0
else
exit 1
fi

clean_up:
name: Clean Up Artifacts
needs: acceptance_test
if: ${{ needs.acceptance_test.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Clean up Linux Build
uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
with:
name: build-artifact-linux-full
failOnError: false
Loading
Loading