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
37 changes: 5 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,17 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Configure git for private modules
run: git config --global url."https://${{ secrets.RELEASES_TOKEN }}@github.com/".insteadOf "https://github.com/"
- run: go build ./...
- run: go test ./... -v -race -count=1
env:
GOPRIVATE: github.com/GoCodeAlone/*
GONOSUMCHECK: github.com/GoCodeAlone/*

strict-contracts:
name: Validate strict plugin contracts
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Verify plugin.json exists
run: |
test -f plugin.json || { echo "ERROR: plugin.json is missing — every release must include a strict contract manifest"; exit 1; }
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Run strict contract tests
run: |
go test ./internal/... -run "TestPluginStepSchemasJSON|TestPluginManifestEngineValidation|TestModuleSchemas" -v -count=1
env:
GOPRIVATE: github.com/GoCodeAlone/*
GONOSUMCHECK: github.com/GoCodeAlone/*
- name: Validate plugin.json with wfctl
run: |
# wfctl validates registry-format manifests; strict contract schema coverage is enforced
# by the Go tests above. This step runs informational validation and logs the result.
set +e
go run github.com/GoCodeAlone/workflow/cmd/wfctl@v0.3.56 plugin validate --file plugin.json 2>&1
wfctl_exit=$?
set -e
echo "wfctl validation exit code: ${wfctl_exit}"
- run: go test ./... -v -race -count=1
env:
GOPRIVATE: github.com/GoCodeAlone/*
GONOSUMCHECK: github.com/GoCodeAlone/*
34 changes: 34 additions & 0 deletions .github/workflows/wfctl-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# .github/workflows/wfctl-validate.yml
name: wfctl strict contracts

on:
pull_request:
push:
branches: [main, master]

jobs:
wfctl-strict-contracts:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Check plugin.json and plugin.contracts.json exist
run: |
if [ ! -f plugin.json ]; then
echo "::error::plugin.json is missing — add a plugin manifest to enable strict contract validation"
exit 1
fi
if [ ! -f plugin.contracts.json ]; then
echo "::error::plugin.contracts.json is missing — add a contracts file to pass strict contract validation"
exit 1
fi

- uses: GoCodeAlone/setup-wfctl@bcd880980f5bbe8d192d0c20ff6279d25331f956
with:
version: latest
token: ${{ secrets.RELEASES_TOKEN }}

- name: Validate strict plugin contracts
run: wfctl plugin validate --file plugin.json --strict-contracts
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ archives:
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
files:
- plugin.json
- plugin.contracts.json
- LICENSE

checksum:
name_template: "checksums.txt"
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
.PHONY: build test install clean
.PHONY: build test install clean proto-gen

# Regenerate Go bindings from proto/github/v1/github.proto.
# Requires: protoc + protoc-gen-go
# brew install protobuf
# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
proto-gen:
protoc \
--proto_path=proto/github/v1 \
--go_out=gen \
--go_opt=paths=source_relative \
proto/github/v1/github.proto

BINARY_NAME = workflow-plugin-github
PROVIDER_BINARY_NAME = github-runner-provider
Expand Down
Loading
Loading