Skip to content
Merged
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
12 changes: 1 addition & 11 deletions .github/workflows/validation-aws.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
name: AWS Validation Tests

on:
schedule:
# Run daily at 2 AM UTC
- cron: "0 2 * * *"
workflow_dispatch:
# Allow manual triggering
pull_request:
paths:
- "v1/providers/aws/**"
- "internal/validation/**"
- "v1/**"
branches: [main]
# Run explicitly from the Actions UI, GitHub CLI, or API.

jobs:
aws-validation:
name: AWS Provider Validation
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/validation-nebius.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
name: Nebius Validation Tests

on:
schedule:
# Run daily at 2 AM UTC
- cron: "0 2 * * *"
workflow_dispatch:
# Allow manual triggering
pull_request:
paths:
- "v1/providers/nebius/**"
- "internal/validation/**"
- "v1/**"
branches: [main]
# Run explicitly from the Actions UI, GitHub CLI, or API.

jobs:
nebius-validation:
name: Nebius Provider Validation
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/validation-shadeform.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
name: Shadeform Validation Tests

on:
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch:
# Allow manual triggering
pull_request:
paths:
- 'v1/providers/shadeform/**'
- 'internal/validation/**'
- 'v1/**'
branches: [ main ]
# Run explicitly from the Actions UI, GitHub CLI, or API.

jobs:
shadeform-validation:
name: Shadeform Provider Validation
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'

steps:
- uses: actions/checkout@v4
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/validation-verda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Verda Validation Tests

on:
workflow_dispatch:
# Run explicitly from the Actions UI, GitHub CLI, or API.

jobs:
verda-validation:
name: Verda Provider Validation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

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

- name: Install dependencies
run: make deps

- name: Run Verda validation tests
env:
VERDA_CLIENT_ID: ${{ secrets.VERDA_CLIENT_ID }}
VERDA_CLIENT_SECRET: ${{ secrets.VERDA_CLIENT_SECRET }}
TEST_PRIVATE_KEY_BASE64: ${{ secrets.TEST_PRIVATE_KEY_BASE64 }}
TEST_PUBLIC_KEY_BASE64: ${{ secrets.TEST_PUBLIC_KEY_BASE64 }}
VALIDATION_TEST: true
run: |
cd v1/providers/verda
go test -v -short=false -timeout=30m ./...

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: verda-validation-results
path: |
v1/providers/verda/coverage.out
61 changes: 40 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ BINARY_NAME=compute
MODULE_NAME=github.com/brevdev/cloud
BUILD_DIR=build
COVERAGE_DIR=coverage
VALIDATION_REF?=$(shell git branch --show-current)

# Load environment variables from .env file if it exists
ifneq (,$(wildcard .env))
Expand Down Expand Up @@ -79,6 +80,23 @@ test-validation:
@echo "Running validation tests..."
$(GOTEST) -v -short=false ./...

# Trigger a provider validation workflow in GitHub Actions
.PHONY: trigger-validation
trigger-validation:
@if [ -z "$(PROVIDER)" ]; then \
echo "Usage: make trigger-validation PROVIDER=<aws|nebius|shadeform|verda> [VALIDATION_REF=<branch>]"; \
exit 1; \
fi
@case "$(PROVIDER)" in \
aws|nebius|shadeform|verda) ;; \
*) echo "Unsupported provider: $(PROVIDER). Expected aws, nebius, shadeform, or verda."; exit 1 ;; \
esac
@if [ -z "$(VALIDATION_REF)" ]; then \
echo "VALIDATION_REF is required when Git is in a detached HEAD state."; \
exit 1; \
fi
gh workflow run validation-$(PROVIDER).yml --ref "$(VALIDATION_REF)"

# Run all tests including validation
.PHONY: test-all
test-all:
Expand Down Expand Up @@ -201,24 +219,25 @@ install-tools:
.PHONY: help
help:
@echo "Available targets:"
@echo " build - Build the project"
@echo " build-all - Build for Linux, macOS, and Windows"
@echo " test - Run tests (with -short flag)"
@echo " test-validation - Run validation tests (without -short flag)"
@echo " test-all - Run all tests including validation"
@echo " test-coverage - Run tests with coverage report"
@echo " test-race - Run tests with race detection"
@echo " bench - Run benchmarks"
@echo " lint - Run linter (golangci-lint)"
@echo " vet - Run go vet"
@echo " fmt - Format code"
@echo " fmt-check - Check if code is formatted"
@echo " security - Run security scan (gosec)"
@echo " clean - Clean build artifacts"
@echo " deps - Install dependencies"
@echo " deps-update - Update dependencies"
@echo " deps-verify - Verify dependencies"
@echo " docs - Generate documentation"
@echo " check - Run all checks (lint, vet, fmt-check, test)"
@echo " install-tools - Install development tools"
@echo " help - Show this help message"
@echo " build - Build the project"
@echo " build-all - Build for Linux, macOS, and Windows"
@echo " test - Run tests (with -short flag)"
@echo " test-validation - Run validation tests (without -short flag)"
@echo " trigger-validation - Trigger one provider validation workflow in GitHub Actions"
@echo " test-all - Run all tests including validation"
@echo " test-coverage - Run tests with coverage report"
@echo " test-race - Run tests with race detection"
@echo " bench - Run benchmarks"
@echo " lint - Run linter (golangci-lint)"
@echo " vet - Run go vet"
@echo " fmt - Format code"
@echo " fmt-check - Check if code is formatted"
@echo " security - Run security scan (gosec)"
@echo " clean - Clean build artifacts"
@echo " deps - Install dependencies"
@echo " deps-update - Update dependencies"
@echo " deps-verify - Verify dependencies"
@echo " docs - Generate documentation"
@echo " check - Run all checks (lint, vet, fmt-check, test)"
@echo " install-tools - Install development tools"
@echo " help - Show this help message"
12 changes: 0 additions & 12 deletions v1/providers/verda/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ func TestValidationFunctions(t *testing.T) {
})
}

func TestGetInstance(t *testing.T) {
checkValidationCredentials(t)
credential := validationCredential()

client, err := credential.MakeClient(context.Background(), "")
require.NoError(t, err)

instance, err := client.GetInstance(context.Background(), v1.CloudProviderInstanceID("b395e9e7-9a21-4ff1-a4b5-fb06d9652942"))
require.NoError(t, err)
require.NotNil(t, instance)
}

func TestInstanceLifecycleValidation(t *testing.T) {
checkValidationCredentials(t)

Expand Down
Loading