Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the ci workflow needlessly complicated #51

Merged
merged 8 commits into from
Jul 29, 2024
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
219 changes: 205 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,95 @@ name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
goreleaser: ${{ steps.goreleaser.outputs.any_changed }}
lint: ${{ steps.lint.outputs.any_changed }}
buf: ${{ steps.buf.outputs.any_changed }}
provisioner: ${{ steps.provisioner.outputs.any_changed || steps.test.outputs.any_changed || github.actor == 'renovate[bot]' }}
provider: ${{ steps.provider.outputs.any_changed || steps.test.outputs.any_changed || github.actor == 'renovate[bot]' }}
sdk: ${{ steps.sdk.outputs.any_changed || steps.provider.outputs.any_changed || github.actor == 'renovate[bot]' }}
test: ${{ steps.test.outputs.any_changed || steps.provisioner.outputs.any_changed || steps.provider.outputs.any_changed || github.actor == 'renovate[bot]' }}
steps:
- name: Chekcout
uses: actions/checkout@v4

- name: Goreleaser triggers
id: goreleaser
uses: tj-actions/changed-files@v44
with:
files: |
.github/workflows/**
.goreleaser.yml

- name: Lint triggers
id: lint
uses: tj-actions/changed-files@v44
with:
files: |
.github/workflows/**
provider/**/*.go
sdk/**/*.go
tests/**/*.go

- name: Buf triggers
id: buf
uses: tj-actions/changed-files@v44
with:
files: |
.github/workflows/**
proto/**/*.proto
buf.gen.yaml
buf.lock
buf.yaml

- name: SDK triggers
id: sdk
uses: tj-actions/changed-files@v44
with:
files: |
.github/workflows/**
sdk/**

- name: Provisioner triggers
id: provisioner
uses: tj-actions/changed-files@v44
with:
files: |
.github/workflows/**
gen/**/*.go
provider/cmd/provisioner/**
provider/pkg/**
provider/*go*

- name: Provider triggers
id: provider
uses: tj-actions/changed-files@v44
with:
files: |
.github/workflows/**
gen/**/*.go
provider/cmd/provider/**
provider/pkg/**
provider/*go*

- name: Test triggers
id: test
uses: tj-actions/changed-files@v44
with:
files: |
.github/workflows/**
test/**

goreleaser:
if: needs.setup.outputs.goreleaser == 'true'
name: GoReleaser Check
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Chekcout
uses: actions/checkout@v4
Expand All @@ -20,9 +102,10 @@ jobs:
version: '~> v2'

lint:
if: github.event_name == 'pull_request'
if: needs.setup.outputs.lint == 'true'
name: Lint
runs-on: ubuntu-latest
needs: [setup]
strategy:
matrix:
module:
Expand All @@ -46,9 +129,10 @@ jobs:
working-directory: ${{ matrix.module }}

buf:
if: github.event_name == 'pull_request'
if: needs.setup.outputs.buf == 'true'
name: Buf
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -79,10 +163,11 @@ jobs:
input: ${{ steps.diff.outputs.all_changed_files }}
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main,ref=HEAD~1"


provisioner:
if: needs.setup.outputs.provisioner == 'true'
name: Provisioner
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -101,22 +186,31 @@ jobs:
with:
repo: pulumi/pulumictl

- name: Touch targets
run: make --touch gen

- name: Make
run: make provisioner

- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
continue-with-unexpected-changes: true

- name: Upload binary
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: provisioner
path: bin/provisioner

provider:
if: needs.setup.outputs.provider == 'true'
name: Provider
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -140,17 +234,114 @@ jobs:
with:
pulumi-version-file: .versions/pulumi

- name: Touch targets
run: make --touch gen

- name: Make
run: make provider

- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
continue-with-unexpected-changes: true

- name: Upload binary
uses: actions/upload-artifact@v4
with:
path: bin/pulumi-resource-baremetal
name: provider

sdk:
if: needs.setup.outputs.sdk == 'true'
name: SDKs
runs-on: ubuntu-latest
needs: [setup, provider]
strategy:
fail-fast: true
matrix:
dotnetversion:
- 6.0.x
goversion:
- 1.21.x
language:
- nodejs
- python
- dotnet
- go
nodeversion:
- 20.x
pythonversion:
- '3.11'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags

- name: Install provider binary
uses: actions/download-artifact@v4
with:
name: provider
path: bin

- run: chmod +x bin/pulumi-resource-baremetal

- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl

- name: Install Pulumi CLI
uses: pulumi/[email protected]

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
cache-dependency-path: sdk/go.sum

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodeversion }}

- name: Setup DotNet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnetversion }}

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pythonversion }}

# Ensure you have consent first
- name: Touch the provider
run: make --touch bin/pulumi-resource-baremetal

- name: Generate SDK
run: make ${{ matrix.language }}_sdk

- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
continue-with-unexpected-changes: true

test:
if: github.event_name == 'pull_request'
if: needs.setup.outputs.test == 'true'
name: Tests
runs-on: ubuntu-latest
needs: [provisioner, provider]
needs: [setup, provisioner]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ jobs:
go-version: ${{ matrix.goversion }}
cache-dependency-path: sdk/go.sum

- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl

- name: Install Pulumi CLI
uses: pulumi/[email protected]

- name: Setup Node
uses: actions/setup-node@v4
with:
Expand All @@ -121,12 +113,13 @@ jobs:
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
with:
allowed-changes: |-
allowed-changes: |
sdk/**/pulumi-plugin.json
sdk/dotnet/Pulumi.*.csproj
sdk/go/**/pulumiUtilities.go
sdk/nodejs/package.json
sdk/python/pyproject.toml
continue-with-unexpected-changes: true

- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.16.0
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ ensure::
cd sdk && go mod tidy
cd tests && go mod tidy

remake::
rm -rf bin .make

provider:: bin/$(PROVIDER)

provider_debug::
Expand Down Expand Up @@ -187,7 +190,9 @@ gen/go/%.pb.go gen/go/%_grpc.pb.go &: $(BUF_CONFIG) proto/%.proto
buf generate --clean --path proto/$*.proto

provider/pkg/%.man: provider/pkg/%.go
man $(notdir $*) > $@
# man $(notdir $*) > $@
# This is a terrible idea when the output depends on the terminal size
touch $@

buf.lock: $(BUF_CONFIG)
buf dep update
Expand Down
17 changes: 11 additions & 6 deletions provider/pkg/provider/cmd/tee.man
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TEE(1) User Commands TEE(1)
TEE(1) User Commands TEE(1)

NAME
tee - read from standard input and write to standard output and files
Expand Down Expand Up @@ -36,8 +36,11 @@ DESCRIPTION
exit-nopipe
exit on error writing to any output not a pipe

The default MODE for the -p option is 'warn-nopipe'. With "nopipe" MODEs, exit immediately if all outputs become broken pipes. The default operation when --output-error is not speci‐
fied, is to exit immediately on error writing to a pipe, and diagnose errors writing to non pipe outputs.
The default MODE for the -p option is 'warn-nopipe'. With "nopipe"
MODEs, exit immediately if all outputs become broken pipes. The de‐
fault operation when --output-error is not specified, is to exit imme‐
diately on error writing to a pipe, and diagnose errors writing to non
pipe outputs.

AUTHOR
Written by Mike Parker, Richard M. Stallman, and David MacKenzie.
Expand All @@ -47,11 +50,13 @@ REPORTING BUGS
Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
Copyright © 2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Copyright © 2024 Free Software Foundation, Inc. License GPLv3+: GNU
GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
Full documentation <https://www.gnu.org/software/coreutils/tee>
or available locally via: info '(coreutils) tee invocation'

GNU coreutils 9.5 March 2024 TEE(1)
GNU coreutils 9.5 March 2024 TEE(1)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Pulumi.Serialization;
using Pulumi;

namespace UnMango.Baremetal.Inputs
namespace UnMango.Baremetal.Cmd.Inputs
{

public sealed class TeeOptsArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Pulumi.Serialization;
using Pulumi;

namespace UnMango.Baremetal.Outputs
namespace UnMango.Baremetal.Cmd.Outputs
{

[OutputType]
Expand Down
File renamed without changes.
Loading
Loading