Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rogpeppe committed Feb 10, 2020
1 parent f79b210 commit 0fb0993
Show file tree
Hide file tree
Showing 11 changed files with 594 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test.yaml
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
1 change: 1 addition & 0 deletions cue.mod/module.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module: "github.com/heetch/cue-schema/github"
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 cue.mod/pkg/github.com/heetch/cue-schema/github/workflow/event.cue
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
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
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
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"]
}
Loading

0 comments on commit 0fb0993

Please sign in to comment.