Skip to content

Commit

Permalink
chore: cleanup, prep project for use
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Sep 3, 2023
1 parent 9216026 commit 248784b
Show file tree
Hide file tree
Showing 30 changed files with 1,040 additions and 183 deletions.
54 changes: 23 additions & 31 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
common:verbose --announce_rc

build --java_language_version=11
build --java_runtime_version=remotejdk_11

#build --extra_toolchains=@graalvm//:sdk

# build --config=labs
# build --config=strict
# build --config=hermetic

# build --enable_bzlmod
# build --config=bzlmod
build:macos --config=strict
build:macos --config=hermetic
build:macos --config=labs

# Import Aspect bazelrc presets
# import %workspace%/.aspect/bazelrc/convenience.bazelrc
# import %workspace%/.aspect/bazelrc/correctness.bazelrc
# import %workspace%/.aspect/bazelrc/debug.bazelrc
# import %workspace%/.aspect/bazelrc/performance.bazelrc
import %workspace%/.aspect/bazelrc/convenience.bazelrc
import %workspace%/.aspect/bazelrc/correctness.bazelrc
import %workspace%/.aspect/bazelrc/debug.bazelrc
import %workspace%/.aspect/bazelrc/performance.bazelrc

# Import project-level presets
# import %workspace%/tools/bazel/base.bazelrc
# import %workspace%/tools/bazel/buildbuddy.bazelrc
# import %workspace%/tools/bazel/cache.bazelrc
# import %workspace%/tools/bazel/ci.bazelrc
# import %workspace%/tools/bazel/bzlmod.bazelrc
# import %workspace%/tools/bazel/profiles.bazelrc
# import %workspace%/tools/bazel/dev.bazelrc
# import %workspace%/tools/bazel/labs.bazelrc
# import %workspace%/tools/bazel/strict.bazelrc
# import %workspace%/tools/bazel/hermetic.bazelrc
# import %workspace%/tools/bazel/java.bazelrc
# import %workspace%/tools/bazel/windows.bazelrc
# import %workspace%/tools/bazel/linux.bazelrc
# import %workspace%/tools/bazel/macos.bazelrc
import %workspace%/tools/bazel/base.bazelrc
import %workspace%/tools/bazel/buildbuddy.bazelrc
import %workspace%/tools/bazel/cache.bazelrc
import %workspace%/tools/bazel/ci.bazelrc
import %workspace%/tools/bazel/bzlmod.bazelrc
import %workspace%/tools/bazel/profiles.bazelrc
import %workspace%/tools/bazel/dev.bazelrc
import %workspace%/tools/bazel/labs.bazelrc
import %workspace%/tools/bazel/strict.bazelrc
import %workspace%/tools/bazel/hermetic.bazelrc
import %workspace%/tools/bazel/java.bazelrc
import %workspace%/tools/bazel/windows.bazelrc
import %workspace%/tools/bazel/linux.bazelrc
import %workspace%/tools/bazel/macos.bazelrc

common --color=auto

Expand All @@ -41,5 +33,5 @@ build --verbose_failures
# pick something trivial as a "noop"
common:noop --logging=3

#try-import %workspace%/local.bazelrc
#try-import %workspace%/version.bazelrc
try-import %workspace%/local.bazelrc
try-import %workspace%/version.bazelrc
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.* @sgammon
76 changes: 76 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
5 changes: 5 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Gradle Rules for Bazel: Contribution Guide

This codebase is a conventional Bazel 6 or Bazel 7 codebase. To use it, you build and test from [Bazel](https://bazel.build).

Coming soon.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily

- package-ecosystem: npm
directory: /
schedule:
interval: daily
3 changes: 3 additions & 0 deletions .github/dependency-review-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
license-check: true
vulnerability-check: true
fail-on-severity: "low"
8 changes: 8 additions & 0 deletions .github/workflows/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

buildifier(
name = "buildifier.check",
exclude_patterns = ["./.git/*"],
lint_mode = "warn",
mode = "diff",
)
31 changes: 31 additions & 0 deletions .github/workflows/bazel.ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bazel CI

# Controls when the action will run.
"on":
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}

concurrency:
# Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@29e53247c6366e30acbedfc767f58f79fc05836c
with:
folders: |
[
"."
]
exclude_windows: true
exclude: |
[
{"bazelversion": "5.4.0", "bzlmodEnabled": true},
{"bazelversion": "5.4.0", "bzlmodEnabled": false},
{"bazelversion": "5.4.0", "os": "macos-latest"},
]
43 changes: 43 additions & 0 deletions .github/workflows/check.buildifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Buildifier

# Controls when the action will run.
"on":
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
paths:
- docs/**/*.*
- e2e/**/*.*
- gradle/**/*.*
- internal/**/*.*
- tools/**/*.*

pull_request:
branches: [main]
paths:
- docs/**/*.*
- e2e/**/*.*
- gradle/**/*.*
- internal/**/*.*
- tools/**/*.*

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: buildifier
continue-on-error: true
run: bazel run //.github/workflows:buildifier.check
94 changes: 94 additions & 0 deletions .github/workflows/check.lint-yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
name: "Lint: YAML"

concurrency:
group: lint-yaml-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

"on":
## Check YAML on merge queue insertion
merge_group: {}

## Check on release
release:
types: [created]

## Check on push to `main` if modified
push:
branches:
- main
paths:
- ".github/workflows/*.yaml"
- ".github/workflows/*.yml"
- ".bazelci/presubmit.yml"
- ".bcr/*.yml"

## Check each PR change against `main`
pull_request:
paths:
- ".github/workflows/*.yaml"
- ".github/workflows/*.yml"
- ".bazelci/presubmit.yml"
- ".bcr/*.yml"

permissions:
contents: read

jobs:
## Task: Lint workflows via Actionlint
lint-workflows:
name: "Lint: Workflows"
uses: elide-dev/build-infra/.github/workflows/check.actions-lint.ci.yml@c54d8227f4bd37839a67ab9cb71fb59a0d197aee
permissions:
checks: write
pull-requests: read
id-token: write
contents: read

## Task: Lint Bazel Central Registry config files
lint-bcr-yaml:
name: "Lint: BCR"
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
checks: "write"
pull-requests: "read"
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: "Lint: YAML"
uses: karancode/yamllint-github-action@0a904064817924fc6fb449a32f67f25bfacc48ae # master
with:
yamllint_file_or_dir: ".bcr"
yamllint_config_filepath: "./.github/.yamllint.yml"
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

## Task: Lint Bazel CI config files
lint-bazelci-yaml:
name: "Lint: Bazel CI"
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
checks: "write"
pull-requests: "read"
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- name: "Setup: Checkout"
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: "Lint: YAML"
uses: karancode/yamllint-github-action@0a904064817924fc6fb449a32f67f25bfacc48ae # master
with:
yamllint_file_or_dir: ".bazelci"
yamllint_config_filepath: "./.github/.yamllint.yml"
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 248784b

Please sign in to comment.