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
59 changes: 59 additions & 0 deletions .github/workflows/validation-shadeform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Shadeform Validation Tests

on:
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch:
# Allow manual triggering
pull_request:
paths:
- 'internal/shadeform/**'
- 'internal/validation/**'
- 'pkg/v1/**'
branches: [ main ]

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

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

- 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 Shadeform validation tests
env:
SHADEFORM_API_KEY: ${{ secrets.SHADEFORM_API_KEY }}
TEST_PRIVATE_KEY_BASE64: ${{ secrets.TEST_PRIVATE_KEY_BASE64 }}
TEST_PUBLIC_KEY_BASE64: ${{ secrets.TEST_PUBLIC_KEY_BASE64 }}
VALIDATION_TEST: true
run: |
cd internal/shadeform
go test -v -short=false -timeout=30m ./...

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: shadeform-validation-results
path: |
internal/shadeform/coverage.out
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
__debug_bin*
.idea/*
11 changes: 11 additions & 0 deletions internal/shadeform/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
generate-shadeform-client:
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.8.0 generate \
--additional-properties disallowAdditionalPropertiesIfNotPresent=false \
-i https://raw.githubusercontent.com/shadeform/docs/refs/heads/main/openapi.yaml \
-g go \
--git-user-id brevdev \
--git-repo-id cloud \
-o /local/gen/shadeform
sudo chown -R $(shell id -u):$(shell id -g) gen/shadeform
gofmt -s -w gen/shadeform
rm -rf gen/shadeform/go.mod gen/shadeform/go.sum
24 changes: 24 additions & 0 deletions internal/shadeform/gen/shadeform/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof
23 changes: 23 additions & 0 deletions internal/shadeform/gen/shadeform/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
101 changes: 101 additions & 0 deletions internal/shadeform/gen/shadeform/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
api_default.go
client.go
configuration.go
docs/AddSshKeyRequest.md
docs/AddSshKeyResponse.md
docs/Alert.md
docs/AutoDelete.md
docs/Availability.md
docs/BootTime.md
docs/Cloud.md
docs/CreateRequest.md
docs/CreateResponse.md
docs/CreateVolumeRequest.md
docs/CreateVolumeResponse.md
docs/DefaultAPI.md
docs/DockerConfiguration.md
docs/Env.md
docs/FeaturedTemplate.md
docs/FeaturedTemplatesResponse.md
docs/Instance.md
docs/InstanceConfiguration.md
docs/InstanceInfoResponse.md
docs/InstancePortMappings.md
docs/InstanceType.md
docs/InstanceTypeConfiguration.md
docs/InstanceTypesResponse.md
docs/InstancesResponse.md
docs/LaunchConfiguration.md
docs/Networking.md
docs/PortMappings.md
docs/RegistryCredentials.md
docs/ScriptConfiguration.md
docs/SshKey.md
docs/SshKeysResponse.md
docs/Status.md
docs/Template.md
docs/TemplateCreateResponse.md
docs/TemplateSaveRequest.md
docs/TemplatesResponse.md
docs/UfwRule.md
docs/UpdateRequest.md
docs/Volume.md
docs/VolumeMount.md
docs/VolumeMounts.md
docs/VolumeTypesInner.md
docs/VolumesResponse.md
docs/VolumesTypesResponse.md
git_push.sh
go.mod
go.sum
model_add_ssh_key_request.go
model_add_ssh_key_response.go
model_alert.go
model_auto_delete.go
model_availability.go
model_boot_time.go
model_cloud.go
model_create_request.go
model_create_response.go
model_create_volume_request.go
model_create_volume_response.go
model_docker_configuration.go
model_env.go
model_featured_template.go
model_featured_templates_response.go
model_instance.go
model_instance_configuration.go
model_instance_info_response.go
model_instance_port_mappings.go
model_instance_type.go
model_instance_type_configuration.go
model_instance_types_response.go
model_instances_response.go
model_launch_configuration.go
model_networking.go
model_port_mappings.go
model_registry_credentials.go
model_script_configuration.go
model_ssh_key.go
model_ssh_keys_response.go
model_status.go
model_template.go
model_template_create_response.go
model_template_save_request.go
model_templates_response.go
model_ufw_rule.go
model_update_request.go
model_volume.go
model_volume_mount.go
model_volume_mounts.go
model_volume_types_inner.go
model_volumes_response.go
model_volumes_types_response.go
response.go
test/api_default_test.go
utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.8.0
8 changes: 8 additions & 0 deletions internal/shadeform/gen/shadeform/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: go

install:
- go get -d -v .

script:
- go build -v ./

Loading
Loading