Skip to content

Commit

Permalink
Start to open up the CloudEvents modules.
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Moore <[email protected]>
  • Loading branch information
mattmoor committed Dec 9, 2023
1 parent 6fa3563 commit d973cdc
Show file tree
Hide file tree
Showing 19 changed files with 1,003 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .chainguard/source.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

spec:
authorities:
- keyless:
# allow commits signed by users using GitHub or Google OIDC
identities:
- issuer: https://accounts.google.com
- issuer: https://github.com/login/oauth
- key:
# allow commits signed by GitHub, e.g. the UI
kms: https://github.com/web-flow.gpg
29 changes: 29 additions & 0 deletions .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2022 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

name: Action Lint

on:
pull_request:
branches: [ 'main', 'release-*' ]

jobs:

action-lint:
name: Action lint
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Find yamls
id: get_yamls
run: |

Check failure on line 22 in .github/workflows/actionlint.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/actionlint.yaml#L22

shellcheck reported issue in this script: SC2027:warning:2:14: The surrounding quotes actually unquote this. Remove or escape them [shellcheck]
Raw output
.github/workflows/actionlint.yaml:22:9: shellcheck reported issue in this script: SC2027:warning:2:14: The surrounding quotes actually unquote this. Remove or escape them [shellcheck]

Check failure on line 22 in .github/workflows/actionlint.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/actionlint.yaml#L22

shellcheck reported issue in this script: SC2086:info:2:14: Double quote to prevent globbing and word splitting [shellcheck]
Raw output
.github/workflows/actionlint.yaml:22:9: shellcheck reported issue in this script: SC2086:info:2:14: Double quote to prevent globbing and word splitting [shellcheck]

Check failure on line 22 in .github/workflows/actionlint.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/actionlint.yaml#L22

shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting [shellcheck]
Raw output
.github/workflows/actionlint.yaml:22:9: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting [shellcheck]
yamls=$(find .github/workflows -name "*.y*ml" | grep -v dependabot.)
echo "files="${yamls}"" >> $GITHUB_OUTPUT
- name: Action lint
uses: reviewdog/action-actionlint@82693e9e3b239f213108d6e412506f8b54003586 # v1.39.1
with:
actionlint_flags: ${{ steps.get_yamls.outputs.files }}
39 changes: 39 additions & 0 deletions .github/workflows/boilerplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2022 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

name: Boilerplate

on:
pull_request:
branches: [ 'main', 'release-*' ]

jobs:

check:
name: Boilerplate Check
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
extension:
- go
- sh
- yaml

# Map between extension and human-readable name.
include:
- extension: go
language: Go
- extension: sh
language: Bash
- extension: yaml
language: YAML

steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: chainguard-dev/actions/boilerplate@main
with:
extension: ${{ matrix.extension }}
language: ${{ matrix.language }}
2 changes: 2 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
matrix:
module:
- authorize-private-service
- cloudevent-broker
- cloudevent-trigger

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/donotsubmit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

name: Do Not Submit

on:
pull_request:
branches: [ 'main', 'release-*' ]

jobs:

donotsubmit:
name: Do Not Submit
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Do Not Submit
uses: chainguard-dev/actions/donotsubmit@main
41 changes: 41 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2022 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

name: Test

on:
pull_request:
branches: [ 'main', 'release-*' ]
push:
branches: [ 'main', 'release-*' ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- name: Check out code onto GOPATH
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: './go.mod'
check-latest: true

- run: |

Check failure on line 39 in .github/workflows/go-test.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/go-test.yaml#L39

shellcheck reported issue in this script: SC2046:warning:2:15: Quote this to prevent word splitting [shellcheck]
Raw output
.github/workflows/go-test.yaml:39:7: shellcheck reported issue in this script: SC2046:warning:2:15: Quote this to prevent word splitting [shellcheck]
# Exclude running unit tests against third_party repos.
go test -race $(go list ./... | grep -v third_party/)
110 changes: 110 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Copyright 2022 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

name: Code Style

on:
pull_request:
branches: [ 'main', 'release-*' ]
push:
branches: [ 'main', 'release-*' ]

jobs:

gofmt:
name: check gofmt
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: './go.mod'
check-latest: true

- uses: chainguard-dev/actions/gofmt@main
with:
args: -s

goimports:
name: check goimports
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: './go.mod'
check-latest: true

- uses: chainguard-dev/actions/goimports@main

golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: './go.mod'
check-latest: true
cache: true

- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.54
args: --timeout=5m

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: './go.mod'
check-latest: true

- uses: chainguard-dev/actions/trailing-space@main
if: ${{ always() }}

- uses: chainguard-dev/actions/eof-newline@main
if: ${{ always() }}

- uses: reviewdog/action-tflint@master
if: ${{ always() }}
with:
github_token: ${{ secrets.github_token }}
fail_on_error: true

- uses: reviewdog/action-misspell@cc799b020b057600b66eedf2b6e97ca26137de21 # v1.14.0
if: ${{ always() }}
with:
github_token: ${{ secrets.github_token }}
fail_on_error: true
locale: "US"
exclude: |
**/go.sum
**/third_party/**
./*.yml
- uses: get-woke/woke-action-reviewdog@d71fd0115146a01c3181439ce714e21a69d75e31 # v0
if: ${{ always() }}
with:
github-token: ${{ secrets.github_token }}
reporter: github-pr-check
level: error
fail-on-error: true
35 changes: 35 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2022 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0

linters:
enable:
- asciicheck
- unused
- errcheck
- errorlint
- gofmt
- goimports
- gosec
- gocritic
- importas
- prealloc
- revive
- misspell
- stylecheck
- tparallel
- unconvert
- unparam
- whitespace
output:
uniq-by-line: false
issues:
exclude-rules:
- path: _test\.go
linters:
- errcheck
- gosec
max-issues-per-linter: 0
max-same-issues: 0
run:
issues-exit-code: 1
timeout: 10m
2 changes: 1 addition & 1 deletion authorize-private-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_uri"></a> [uri](#output\_uri) | The URI of the private Cloud Run service. |
<!-- END_TF_DOCS -->
<!-- END_TF_DOCS -->
29 changes: 29 additions & 0 deletions cloudevent-broker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# `cloudevent-broker`

TODO

<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

No providers.

## Modules

No modules.

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.
<!-- END_TF_DOCS -->
Loading

0 comments on commit d973cdc

Please sign in to comment.