Skip to content

Commit 4048bdd

Browse files
authored
Merge pull request #29 from shadeform/main
Add Shadeform integration
2 parents 6888288 + 931901c commit 4048bdd

112 files changed

Lines changed: 28646 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Shadeform Validation Tests
2+
3+
on:
4+
schedule:
5+
# Run daily at 2 AM UTC
6+
- cron: '0 2 * * *'
7+
workflow_dispatch:
8+
# Allow manual triggering
9+
pull_request:
10+
paths:
11+
- 'internal/shadeform/**'
12+
- 'internal/validation/**'
13+
- 'pkg/v1/**'
14+
branches: [ main ]
15+
16+
jobs:
17+
shadeform-validation:
18+
name: Shadeform Provider Validation
19+
runs-on: ubuntu-latest
20+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Go
26+
uses: actions/setup-go@v4
27+
with:
28+
go-version: '1.23.0'
29+
30+
- name: Cache Go modules
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
~/.cache/go-build
35+
~/go/pkg/mod
36+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
37+
restore-keys: |
38+
${{ runner.os }}-go-
39+
40+
- name: Install dependencies
41+
run: make deps
42+
43+
- name: Run Shadeform validation tests
44+
env:
45+
SHADEFORM_API_KEY: ${{ secrets.SHADEFORM_API_KEY }}
46+
TEST_PRIVATE_KEY_BASE64: ${{ secrets.TEST_PRIVATE_KEY_BASE64 }}
47+
TEST_PUBLIC_KEY_BASE64: ${{ secrets.TEST_PUBLIC_KEY_BASE64 }}
48+
VALIDATION_TEST: true
49+
run: |
50+
cd internal/shadeform
51+
go test -v -short=false -timeout=30m ./...
52+
53+
- name: Upload test results
54+
uses: actions/upload-artifact@v4
55+
if: always()
56+
with:
57+
name: shadeform-validation-results
58+
path: |
59+
internal/shadeform/coverage.out

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.env
22
__debug_bin*
3+
.idea/*

internal/shadeform/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
generate-shadeform-client:
2+
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.8.0 generate \
3+
--additional-properties disallowAdditionalPropertiesIfNotPresent=false \
4+
-i https://raw.githubusercontent.com/shadeform/docs/refs/heads/main/openapi.yaml \
5+
-g go \
6+
--git-user-id brevdev \
7+
--git-repo-id cloud \
8+
-o /local/gen/shadeform
9+
sudo chown -R $(shell id -u):$(shell id -g) gen/shadeform
10+
gofmt -s -w gen/shadeform
11+
rm -rf gen/shadeform/go.mod gen/shadeform/go.sum
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
2+
*.o
3+
*.a
4+
*.so
5+
6+
# Folders
7+
_obj
8+
_test
9+
10+
# Architecture specific extensions/prefixes
11+
*.[568vq]
12+
[568vq].out
13+
14+
*.cgo1.go
15+
*.cgo2.c
16+
_cgo_defun.c
17+
_cgo_gotypes.go
18+
_cgo_export.*
19+
20+
_testmain.go
21+
22+
*.exe
23+
*.test
24+
*.prof
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
.gitignore
2+
.openapi-generator-ignore
3+
.travis.yml
4+
README.md
5+
api/openapi.yaml
6+
api_default.go
7+
client.go
8+
configuration.go
9+
docs/AddSshKeyRequest.md
10+
docs/AddSshKeyResponse.md
11+
docs/Alert.md
12+
docs/AutoDelete.md
13+
docs/Availability.md
14+
docs/BootTime.md
15+
docs/Cloud.md
16+
docs/CreateRequest.md
17+
docs/CreateResponse.md
18+
docs/CreateVolumeRequest.md
19+
docs/CreateVolumeResponse.md
20+
docs/DefaultAPI.md
21+
docs/DockerConfiguration.md
22+
docs/Env.md
23+
docs/FeaturedTemplate.md
24+
docs/FeaturedTemplatesResponse.md
25+
docs/Instance.md
26+
docs/InstanceConfiguration.md
27+
docs/InstanceInfoResponse.md
28+
docs/InstancePortMappings.md
29+
docs/InstanceType.md
30+
docs/InstanceTypeConfiguration.md
31+
docs/InstanceTypesResponse.md
32+
docs/InstancesResponse.md
33+
docs/LaunchConfiguration.md
34+
docs/Networking.md
35+
docs/PortMappings.md
36+
docs/RegistryCredentials.md
37+
docs/ScriptConfiguration.md
38+
docs/SshKey.md
39+
docs/SshKeysResponse.md
40+
docs/Status.md
41+
docs/Template.md
42+
docs/TemplateCreateResponse.md
43+
docs/TemplateSaveRequest.md
44+
docs/TemplatesResponse.md
45+
docs/UfwRule.md
46+
docs/UpdateRequest.md
47+
docs/Volume.md
48+
docs/VolumeMount.md
49+
docs/VolumeMounts.md
50+
docs/VolumeTypesInner.md
51+
docs/VolumesResponse.md
52+
docs/VolumesTypesResponse.md
53+
git_push.sh
54+
go.mod
55+
go.sum
56+
model_add_ssh_key_request.go
57+
model_add_ssh_key_response.go
58+
model_alert.go
59+
model_auto_delete.go
60+
model_availability.go
61+
model_boot_time.go
62+
model_cloud.go
63+
model_create_request.go
64+
model_create_response.go
65+
model_create_volume_request.go
66+
model_create_volume_response.go
67+
model_docker_configuration.go
68+
model_env.go
69+
model_featured_template.go
70+
model_featured_templates_response.go
71+
model_instance.go
72+
model_instance_configuration.go
73+
model_instance_info_response.go
74+
model_instance_port_mappings.go
75+
model_instance_type.go
76+
model_instance_type_configuration.go
77+
model_instance_types_response.go
78+
model_instances_response.go
79+
model_launch_configuration.go
80+
model_networking.go
81+
model_port_mappings.go
82+
model_registry_credentials.go
83+
model_script_configuration.go
84+
model_ssh_key.go
85+
model_ssh_keys_response.go
86+
model_status.go
87+
model_template.go
88+
model_template_create_response.go
89+
model_template_save_request.go
90+
model_templates_response.go
91+
model_ufw_rule.go
92+
model_update_request.go
93+
model_volume.go
94+
model_volume_mount.go
95+
model_volume_mounts.go
96+
model_volume_types_inner.go
97+
model_volumes_response.go
98+
model_volumes_types_response.go
99+
response.go
100+
test/api_default_test.go
101+
utils.go
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.8.0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: go
2+
3+
install:
4+
- go get -d -v .
5+
6+
script:
7+
- go build -v ./
8+

0 commit comments

Comments
 (0)