Skip to content

Commit 68eadb4

Browse files
authored
Import serverless (#1)
This PR promotes the log-specific parts of the `/serverless` directory from `google/trillian-examples` into its own repo. Notable differences: - The `clone2serverless` tool has not been imported; it depends on the `clone` package in `trillian-examples`. - The `deploy/github/distributor/...` hierarchy has not been imported. - `md-lint` issues have been fixed in the `README` file.
1 parent f7d3df5 commit 68eadb4

File tree

112 files changed

+7636
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+7636
-0
lines changed

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: daily
12+
13+
- package-ecosystem: docker
14+
directory: /deploy/github/log/leaf_validator
15+
schedule:
16+
interval: daily
17+
18+
- package-ecosystem: docker
19+
directory: /deploy/github/log/sequence_and_integrate
20+
schedule:
21+
interval: daily
22+

.github/workflows/codeql.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "main" ]
20+
schedule:
21+
- cron: '22 20 * * 5'
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
analyze:
28+
name: Analyze
29+
runs-on: ubuntu-latest
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language: [ 'go' ]
39+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
45+
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.1.34
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
54+
55+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
56+
# queries: security-extended,security-and-quality
57+
58+
59+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
60+
# If this step fails, then you should remove it and run the build manually (see below)
61+
- name: Autobuild
62+
uses: github/codeql-action/autobuild@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.1.34
63+
64+
# ℹ️ Command-line programs to run using the OS shell.
65+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
66+
67+
# If the Autobuild fails above, remove it and uncomment the following three lines.
68+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
69+
70+
# - run: |
71+
# echo "Run, Build Application using script"
72+
# ./location_of_script_within_repo/buildscript.sh
73+
74+
- name: Perform CodeQL Analysis
75+
uses: github/codeql-action/analyze@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.1.34
76+
with:
77+
category: "/language:${{matrix.language}}"

.github/workflows/go_test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on: [push, pull_request]
2+
name: Test Go
3+
permissions:
4+
contents: read
5+
jobs:
6+
test:
7+
strategy:
8+
matrix:
9+
go-version: [1.20.x, 1.21.x]
10+
os: [ubuntu-latest, macos-latest]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
14+
with:
15+
go-version: ${{ matrix.go-version }}
16+
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
17+
- run: go test -race -covermode=atomic -coverprofile=coverage.out ./...
18+
- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4

.github/workflows/golangci-lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
pull_request:
5+
permissions:
6+
contents: read
7+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
8+
# pull-requests: read
9+
jobs:
10+
golangci:
11+
name: lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
15+
with:
16+
go-version: 1.20
17+
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
18+
- name: golangci-lint
19+
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
20+
with:
21+
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
22+
version: v1.54.1

.github/workflows/scorecard.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '23 13 * * 6'
14+
push:
15+
branches: [ "main" ]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# Needed to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write
29+
# Uncomment the permissions below if installing in a private repository.
30+
# contents: read
31+
# actions: read
32+
33+
steps:
34+
- name: "Checkout code"
35+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
36+
with:
37+
persist-credentials: false
38+
39+
- name: "Run analysis"
40+
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0
41+
with:
42+
results_file: results.sarif
43+
results_format: sarif
44+
# (Optional) Read-only PAT token. Uncomment the `repo_token` line below if:
45+
# - you want to enable the Branch-Protection check on a *public* repository, or
46+
# - you are installing Scorecards on a *private* repository
47+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
48+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
49+
50+
# Public repositories:
51+
# - Publish results to OpenSSF REST API for easy access by consumers
52+
# - Allows the repository to include the Scorecard badge.
53+
# - See https://github.com/ossf/scorecard-action#publishing-results.
54+
# For private repositories:
55+
# - `publish_results` will always be set to `false`, regardless
56+
# of the value entered here.
57+
publish_results: true
58+
59+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
60+
# format to the repository Actions tab.
61+
- name: "Upload artifact"
62+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
63+
with:
64+
name: SARIF file
65+
path: results.sarif
66+
retention-days: 5
67+
68+
# Upload the results to GitHub's code scanning dashboard.
69+
- name: "Upload to code-scanning"
70+
uses: github/codeql-action/upload-sarif@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5
71+
with:
72+
sarif_file: results.sarif

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to this project.
4+
5+
## Before you begin
6+
7+
### Sign our Contributor License Agreement
8+
9+
Contributions to this project must be accompanied by a
10+
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
11+
You (or your employer) retain the copyright to your contribution; this simply
12+
gives us permission to use and redistribute your contributions as part of the
13+
project.
14+
15+
If you or your current employer have already signed the Google CLA (even if it
16+
was for a different project), you probably don't need to do it again.
17+
18+
Visit <https://cla.developers.google.com/> to see your current agreements or to
19+
sign a new one.
20+
21+
### Review our Community Guidelines
22+
23+
This project follows
24+
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
25+
26+
## Contribution process
27+
28+
### Code Reviews
29+
30+
All submissions, including submissions by project members, require review. We
31+
use GitHub pull requests for this purpose. Consult
32+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
33+
information on using pull requests.

0 commit comments

Comments
 (0)