-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add formatting tests for go, markdown and yaml
- Loading branch information
Showing
14 changed files
with
685 additions
and
103 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 @@ | ||
node_modules |
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 |
---|---|---|
@@ -1,27 +1,22 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: bazelbuild/setup-bazelisk@v1 | ||
|
||
# Setup Credential Helper to authenticate to Github Container Registry | ||
- run: echo '{"credHelpers":{"ghcr.io":"ghcr"}}' > ~/.docker/config.json | ||
- run: echo "${HOME}/.local/bin" >> $GITHUB_PATH | ||
- run: mkdir -p ~/.local/bin | ||
- run: echo -e "#!/usr/bin/env bash\n echo '{\"ServerURL\":\"ghcr.io\",\"Username\":\"Bearer\",\"Secret\":\"${{ secrets.GITHUB_TOKEN }}\"}'" > ~/.local/bin/docker-credential-ghcr | ||
- run: chmod +x ~/.local/bin/docker-credential-ghcr | ||
|
||
# Setup local toolchain | ||
- run: bazel build --config=ci //go/cmd/ocitool:ocitool && cp bazel-bin/go/cmd/ocitool/ocitool_/ocitool bin/ocitool-linux-amd64 | ||
|
||
# Run all tests | ||
- run: bazel test --config=ci //... |
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 |
---|---|---|
|
@@ -4,3 +4,5 @@ bazel-rules_oci | |
bazel-testlogs | ||
|
||
bin/ocitool-* | ||
|
||
node_modules |
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 @@ | ||
docs |
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 @@ | ||
exclude: ["pnpm-lock.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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,5 @@ | ||
{ | ||
"devDependencies": { | ||
"prettier": "^3.4.2" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,34 @@ | ||
load("@aspect_rules_lint//format:defs.bzl", "format_multirun", "format_test") | ||
load("@npm//:prettier/package_json.bzl", prettier = "bin") | ||
|
||
package(default_visibility = ["//:__subpackages__"]) | ||
|
||
prettier.prettier_binary( | ||
name = "prettier", | ||
env = { | ||
# Allow the binary to be run outside bazel | ||
"BAZEL_BINDIR": ".", | ||
}, | ||
fixed_args = [ | ||
"--log-level=warn", | ||
], | ||
) | ||
|
||
format_multirun( | ||
name = "format", | ||
go = "@go_sdk//:bin/gofmt", | ||
markdown = ":prettier", | ||
starlark = "@buildifier_prebuilt//:buildifier", | ||
yaml = "@aspect_rules_lint//format:yamlfmt", | ||
) | ||
|
||
format_test( | ||
name = "format_test", | ||
size = "small", | ||
go = "@go_sdk//:bin/gofmt", | ||
markdown = ":prettier", | ||
no_sandbox = True, | ||
starlark = "@buildifier_prebuilt//:buildifier", | ||
workspace = "//:WORKSPACE", | ||
yaml = "@aspect_rules_lint//format:yamlfmt", | ||
) |