This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
594 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Code generated by github.com/heetch/cue-schema/github/workflow/generate. DO NOT EDIT. | ||
jobs: | ||
test: | ||
runs-on: ${{ matrix.platform }} | ||
services: | ||
kafka: | ||
env: | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 | ||
KAFKA_BROKER_ID: "1" | ||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1" | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
image: confluentinc/cp-kafka:latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Module cache | ||
uses: actions/cache@v1 | ||
with: | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
path: ~/go/pkg/mod | ||
restore-keys: ${{ runner.os }}-go- | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Test | ||
run: go test ./... | ||
strategy: | ||
matrix: | ||
go-version: | ||
- 1.13.x | ||
platform: | ||
- ubuntu-latest | ||
name: Test | ||
"on": | ||
- push | ||
- pull_request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module: "" |
1 change: 1 addition & 0 deletions
1
cue.mod/pkg/github.com/heetch/cue-schema/github/cue.mod/module.cue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module: "github.com/heetch/cue-schema/github" |
19 changes: 19 additions & 0 deletions
19
cue.mod/pkg/github.com/heetch/cue-schema/github/generate/generate-workflow.cue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package generate | ||
|
||
import ( | ||
"tool/file" | ||
"encoding/yaml" | ||
"github.com/heetch/cue-schema/github/workflow" | ||
) | ||
|
||
Workflow :: workflow | ||
|
||
command: generateworkflow: { | ||
task: write: file.Create & { | ||
filename: ".github/workflows/test.yaml" | ||
contents: """ | ||
# Code generated by github.com/heetch/cue-schema/github/workflow/generate. DO NOT EDIT. | ||
\(yaml.Marshal(Workflow)) | ||
""" | ||
} | ||
} |
217 changes: 217 additions & 0 deletions
217
cue.mod/pkg/github.com/heetch/cue-schema/github/workflow/event.cue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
package workflow | ||
|
||
Event :: | ||
"check_run" | | ||
"check_suite" | | ||
"commit_comment" | | ||
"create" | | ||
"delete" | | ||
"deployment" | | ||
"deployment_status" | | ||
"fork" | | ||
"gollum" | | ||
"issue_comment" | | ||
"issues" | | ||
"label" | | ||
"member" | | ||
"milestone" | | ||
"page_build" | | ||
"project" | | ||
"project_card" | | ||
"project_column" | | ||
"public" | | ||
"pull_request" | | ||
"pull_request_review" | | ||
"pull_request_review_comment" | | ||
"push" | | ||
"release" | | ||
"repository_dispatch" | | ||
"schedule" | | ||
"status" | | ||
"watch" | ||
|
||
EventConfig :: { | ||
check_run?: null | { | ||
type = | ||
"created" | | ||
"rerequested" | | ||
"completed" | | ||
"requested_action" | ||
types?: [ ... type] | ||
} | ||
check_suite?: null | { | ||
type = | ||
"assigned" | | ||
"unassigned" | | ||
"labeled" | | ||
"unlabeled" | | ||
"opened" | | ||
"edited" | | ||
"closed" | | ||
"reopened" | | ||
"synchronize" | | ||
"ready_for_review" | | ||
"locked" | | ||
"unlocked " | | ||
"review_requested " | | ||
"review_request_removed" | ||
types?: [ ... type] | ||
} | ||
commit_comment?: null | {} | ||
create?: null | {} | ||
delete?: null | {} | ||
deployment?: null | {} | ||
deployment_status?: null | {} | ||
fork?: null | {} | ||
gollum?: null | {} | ||
issue_comment?: null | { | ||
type = | ||
"created" | | ||
"edited" | | ||
"deleted" | ||
types?: [ ... type] | ||
} | ||
issues?: null | { | ||
type = | ||
"opened" | | ||
"edited" | | ||
"deleted" | | ||
"transferred" | | ||
"pinned" | | ||
"unpinned" | | ||
"closed" | | ||
"reopened" | | ||
"assigned" | | ||
"unassigned" | | ||
"labeled" | | ||
"unlabeled" | | ||
"locked" | | ||
"unlocked" | | ||
"milestoned" | | ||
"demilestoned" | ||
types?: [ ... type] | ||
} | ||
label?: null | { | ||
type = | ||
"created" | | ||
"edited" | | ||
"deleted" | ||
types?: [ ... type] | ||
} | ||
member?: null | { | ||
type = | ||
"added" | | ||
"edited" | | ||
"deleted" | ||
types?: [ ... type] | ||
} | ||
milestone?: null | { | ||
type = | ||
"created" | | ||
"closed" | | ||
"opened" | | ||
"edited" | | ||
"deleted" | ||
types?: [ ... type] | ||
} | ||
page_build?: null | {} | ||
project?: null | { | ||
type = | ||
"created" | | ||
"closed" | | ||
"opened" | | ||
"edited" | | ||
"deleted" | ||
types?: [ ... type] | ||
} | ||
project_card?: null | { | ||
type = | ||
"created" | | ||
"moved" | | ||
"converted" | | ||
"edited" | | ||
"deleted" | ||
types?: [ ... type] | ||
} | ||
project_column?: null | { | ||
type = | ||
"created" | | ||
"updated" | | ||
"moved" | | ||
"deleted" | ||
types?: [ ... type] | ||
} | ||
public?: null | {} | ||
pull_request?: null | { | ||
PushPullEvent | ||
type = | ||
"assigned" | | ||
"unassigned" | | ||
"labeled" | | ||
"unlabeled" | | ||
"opened" | | ||
"edited" | | ||
"closed" | | ||
"reopened" | | ||
"synchronize" | | ||
"ready_for_review" | | ||
"locked" | | ||
"unlocked " | | ||
"review_requested " | | ||
"review_request_removed" | ||
types?: [ ... type] | ||
} | ||
pull_request_review?: null | { | ||
type = | ||
"submitted" | | ||
"edited" | | ||
"dismissed" | ||
types?: [ ... type] | ||
} | ||
pull_request_review_comment?: null | { | ||
type = | ||
"created" | | ||
"edited" | | ||
"deleted" | ||
types?: [ ... type] | ||
} | ||
push?: null | { | ||
PushPullEvent | ||
} | ||
release?: null | { | ||
type = | ||
"published " | | ||
"unpublished " | | ||
"created " | | ||
"edited " | | ||
"deleted " | | ||
"prereleased" | ||
types? : [ ... type] | ||
} | ||
repository_dispatch?: null | {} | ||
// schedule configures a workflow to run at specific UTC times using POSIX | ||
// cron syntax. Scheduled workflows run on the latest commit on the | ||
// default or base branch. | ||
schedule?: null | [{ | ||
// cron specifies the time schedule in cron syntax. | ||
// See https://help.github.com/en/articles/events-that-trigger-workflows#scheduled-events | ||
// TODO regexp for cron syntax | ||
cron: string | ||
}] | ||
status?: null | {} | ||
watch?: null | { | ||
types?: [ "started"] | ||
} | ||
} | ||
|
||
PushPullEvent :: { | ||
branches?: [... Glob] | ||
tags?: [... Glob] | ||
"branches-ignore"?: [... Glob] | ||
"tags-ignore"?: [... Glob] | ||
paths?: [... Glob] | ||
} | ||
|
||
// Glob represents a wildcard pattern. | ||
// See https://help.github.com/en/articles/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet | ||
Glob :: string |
44 changes: 44 additions & 0 deletions
44
...d/pkg/github.com/heetch/cue-schema/github/workflow/example/go/.github/workflows/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Code generated by github.com/heetch/cue-schema/github/workflow/generate. DO NOT EDIT. | ||
jobs: | ||
test: | ||
runs-on: ${{ matrix.platform }} | ||
services: | ||
kafka: | ||
env: | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 | ||
KAFKA_BROKER_ID: "1" | ||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1" | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
image: confluentinc/cp-kafka:latest | ||
postgres: | ||
env: | ||
POSTGRES_DB: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
image: postgres:10.8 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Test | ||
run: go test ./... | ||
strategy: | ||
matrix: | ||
go-version: | ||
- v1.12.x | ||
- v1.13.x | ||
platform: | ||
- ubuntu-latest | ||
name: My CI caboodle | ||
"on": | ||
- push | ||
- pull_request |
42 changes: 42 additions & 0 deletions
42
cue.mod/pkg/github.com/heetch/cue-schema/github/workflow/example/go/ci.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
jobs: | ||
test: | ||
runs-on: ${{ matrix.platform }} | ||
services: | ||
kafka: | ||
env: | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092 | ||
KAFKA_BROKER_ID: "1" | ||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "1" | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
image: confluentinc/cp-kafka:latest | ||
postgres: | ||
env: | ||
POSTGRES_DB: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
image: postgres:10.8 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Test | ||
run: go test ./... | ||
strategy: | ||
matrix: | ||
go-version: | ||
- go1.13.4 | ||
platform: | ||
- ubuntu-latest | ||
name: My CI caboodle | ||
"on": | ||
- push | ||
- pull_request |
12 changes: 12 additions & 0 deletions
12
cue.mod/pkg/github.com/heetch/cue-schema/github/workflow/example/go/go.cue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package go | ||
|
||
import ( | ||
goworkflow "github.com/heetch/cue-schema/github/workflow/go:workflow" | ||
) | ||
|
||
Workflow :: goworkflow | ||
Workflow :: { | ||
name: "My CI caboodle" | ||
Versions :: ["v1.12", "v1.13"] | ||
Services :: ["postgres", "kafka"] | ||
} |
Oops, something went wrong.