Skip to content

Commit

Permalink
Enable release verification
Browse files Browse the repository at this point in the history
As part of pulumi/ci-mgmt#1201, we are enabling release
verification on `pulumi-random`.
  • Loading branch information
iwahbe committed Dec 10, 2024
1 parent 49707af commit ed77e42
Show file tree
Hide file tree
Showing 15 changed files with 547 additions and 23 deletions.
7 changes: 6 additions & 1 deletion .ci-mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ actions:
run: |
cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
pulumiConvert: 1
registryDocs: true
registryDocs: true
releaseVerification:
nodejs: simple/ts
python: simple/py
dotnet: simple/csharp
go: simple/go
44 changes: 34 additions & 10 deletions .github/workflows/verify-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,13 @@ env:
jobs:
verify-release:
name: verify-release
# We don't have any release verification configurations, so we never run this workflow.
# Configure your .ci-mgmt.yaml files to include the release verification configurations e.g.
# releaseVerification:
# nodejs: path/to/nodejs/project
# python: path/to/python/project
# dotnet: path/to/dotnet/project
# go: path/to/go/project
if: false
strategy:
matrix:
# We don't have any release verification configurations, so we only run on Linux to print warnings to help users configure the release verification.
runner: ["ubuntu-latest"]
# We always run on Linux and Windows, and optionally on MacOS. This is because MacOS runners have limited availability.
# Expression expands to ["ubuntu-latest","windows-latest"] or ["ubuntu-latest","windows-latest","macos-latest"]
# GitHub expressions don't have 'if' statements, so we use a ternary operator to conditionally include the MacOS runner suffix.
# See the docs for a similar example to this: https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson
runner: ${{ fromJSON(format('["ubuntu-latest","windows-latest"{0}]', github.event.inputs.enableMacRunner == 'true' && ',"macos-latest"' || '')) }}
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout Repo
Expand All @@ -76,3 +71,32 @@ jobs:
uses: ./.github/actions/setup-tools
with:
tools: pulumicli, nodejs, python, dotnet, go, java
- name: Verify nodejs release
uses: pulumi/verify-provider-release@v1
with:
runtime: nodejs
directory: simple/ts
provider: random
providerVersion: ${{ inputs.providerVersion }}
- name: Verify python release
uses: pulumi/verify-provider-release@v1
with:
runtime: python
directory: simple/py
provider: random
providerVersion: ${{ inputs.providerVersion }}
- name: Verify dotnet release
uses: pulumi/verify-provider-release@v1
with:
runtime: dotnet
directory: simple/csharp
provider: random
providerVersion: ${{ inputs.providerVersion }}
- name: Verify go release
uses: pulumi/verify-provider-release@v1
if: inputs.skipGoSdk == false
with:
runtime: go
directory: simple/go
provider: random
providerVersion: ${{ inputs.providerVersion }}
16 changes: 12 additions & 4 deletions examples/examples_dotnet_test.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//go:build dotnet || all
// +build dotnet all

package examples

import (
"path/filepath"
"testing"

"github.com/pulumi/pulumi/pkg/v3/testing/integration"
)

func TestSimpleDotnet(t *testing.T) {
test := getCsharpBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "simple", "csharp"),
})

integration.ProgramTest(t, &test)
}

func getCsharpBaseOptions(t *testing.T) integration.ProgramTestOptions {
base := getBaseOptions(t)
baseCsharp := base.With(integration.ProgramTestOptions{
return getBaseOptions(t).With(integration.ProgramTestOptions{
Dependencies: []string{
"Pulumi.Random",
},
})

return baseCsharp
}
28 changes: 28 additions & 0 deletions examples/examples_go_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//go:build go || all
// +build go all

package examples

import (
"path/filepath"
"testing"

"github.com/pulumi/pulumi/pkg/v3/testing/integration"
)

func TestSimpleGo(t *testing.T) {
test := getGoBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "simple", "go"),
RunUpdateTest: false,
})

integration.ProgramTest(t, &test)
}

func getGoBaseOptions(t *testing.T) integration.ProgramTestOptions {
return getBaseOptions(t).With(integration.ProgramTestOptions{
Dependencies: []string{filepath.Join("..", "sdk", "go")},
})
}
5 changes: 1 addition & 4 deletions examples/examples_nodejs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ func TestProviderUpdate(t *testing.T) {
}

func getJSBaseOptions(t *testing.T) integration.ProgramTestOptions {
base := getBaseOptions(t)
baseJS := base.With(integration.ProgramTestOptions{
return getBaseOptions(t).With(integration.ProgramTestOptions{
Dependencies: []string{
"@pulumi/random",
},
})

return baseJS
}
6 changes: 2 additions & 4 deletions examples/examples_py_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//go:build python || all
// +build python all

package examples
Expand All @@ -21,12 +22,9 @@ func TestSimplePy(t *testing.T) {
}

func getPythonBaseOptions(t *testing.T) integration.ProgramTestOptions {
base := getBaseOptions(t)
basePython := base.With(integration.ProgramTestOptions{
return getBaseOptions(t).With(integration.ProgramTestOptions{
Dependencies: []string{
filepath.Join("..", "sdk", "python", "bin"),
},
})

return basePython
}
1 change: 1 addition & 0 deletions examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ replace (

require (
github.com/pulumi/pulumi-random/provider/v4 v4.0.0-20230306191832-8c7659ab0229
github.com/pulumi/pulumi-random/sdk/v4 v4.16.7
github.com/pulumi/pulumi-terraform-bridge/v3 v3.97.0
github.com/pulumi/pulumi/pkg/v3 v3.142.0
github.com/pulumi/pulumi/sdk/v3 v3.142.0
Expand Down
2 changes: 2 additions & 0 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,8 @@ github.com/pulumi/providertest v0.1.3 h1:GpNKRy/haNjRHiUA9bi4diU4Op2zf3axYXbga5A
github.com/pulumi/providertest v0.1.3/go.mod h1:GcsqEGgSngwaNOD+kICJPIUQlnA911fGBU8HDlJvVL0=
github.com/pulumi/pulumi-java/pkg v0.18.0 h1:3PApc5YegH69n6oubB63mqI97pF+oQywWr7ii4082Mw=
github.com/pulumi/pulumi-java/pkg v0.18.0/go.mod h1:YKYYFEb3Jvzf/dDJo0xOeEkIfBAMkkkdhXulauvEjmc=
github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 h1:39rhOe/PTUGMYia8pR5T2wbxxMt2pwrlonf0ncYKSzE=
github.com/pulumi/pulumi-random/sdk/v4 v4.16.7/go.mod h1:cxxDhJzUPt/YElfvlWa15Q4NGF6XXS8kUs4OQsCxSBk=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.97.0 h1:/Y/9hffZp2CFUfInVbv/9rWnZETiiOgKju1Ua512Ke8=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.97.0/go.mod h1:B/Auryr+yVUkLOMzgpFe7HLwKAtXc6YJwpAXfNGyLPk=
github.com/pulumi/pulumi-yaml v1.12.0 h1:ThJP+EBqeJyCnS6w6/PwcEFOT5o112qv0lObhefmFCk=
Expand Down
22 changes: 22 additions & 0 deletions examples/simple/csharp/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.Threading.Tasks;

using Pulumi;
using Pulumi.Random;

class Program
{
static Task<int> Main()
{
return Deployment.RunAsync(() => {

var pet = new RandomPet("bucket", new PetArgs
{
});
return new Dictionary<string, object>
{
{ "pet", pet.id },
};
});
}
}
3 changes: 3 additions & 0 deletions examples/simple/csharp/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: simple-cs
description: "A minimal C# Pulumi program using Pulumi.Random."
runtime: dotnet
9 changes: 9 additions & 0 deletions examples/simple/csharp/Simple.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
3 changes: 3 additions & 0 deletions examples/simple/go/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: simple-go
description: "A minimal Go Pulumi program using Pulumi.Random."
runtime: go
91 changes: 91 additions & 0 deletions examples/simple/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
module github.com/pulumi/pulumi-random/examples/simple/go

go 1.23.4

require (
github.com/pulumi/pulumi-random/sdk/v4 v4.16.7
github.com/pulumi/pulumi/sdk/v3 v3.142.0
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/charmbracelet/bubbles v0.16.1 // indirect
github.com/charmbracelet/bubbletea v0.25.0 // indirect
github.com/charmbracelet/lipgloss v0.7.1 // indirect
github.com/cheggaaa/pb v1.0.29 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/djherbis/times v1.5.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git/v5 v5.12.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl/v2 v2.17.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/opentracing/basictracer-go v1.1.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pgavlin/fx v0.1.6 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
github.com/pulumi/esc v0.9.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/zclconf/go-cty v1.13.2 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/frand v1.4.2 // indirect
)
Loading

0 comments on commit ed77e42

Please sign in to comment.