Skip to content

Commit a8ef0eb

Browse files
committed
rules_tcl 0.0.1
1 parent 19122b3 commit a8ef0eb

59 files changed

Lines changed: 1805 additions & 0 deletions

Some content is hidden

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

.bazelrc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
###############################################################################
2+
## Bazel Configuration Flags
3+
##
4+
## `.bazelrc` is a Bazel configuration file.
5+
## https://bazel.build/docs/best-practices#bazelrc-file
6+
###############################################################################
7+
8+
# https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config
9+
common --enable_platform_specific_config
10+
11+
# Enable the only currently supported report type
12+
# https://bazel.build/reference/command-line-reference#flag--combined_report
13+
coverage --combined_report=lcov
14+
15+
# Avoid fully cached builds reporting no coverage and failing CI
16+
# https://bazel.build/reference/command-line-reference#flag--experimental_fetch_all_coverage_outputs
17+
coverage --experimental_fetch_all_coverage_outputs
18+
19+
# https://github.com/bazelbuild/bazel/issues/8195
20+
build --incompatible_disallow_empty_glob=true
21+
22+
# https://github.com/bazelbuild/bazel/issues/12821
23+
build --nolegacy_external_runfiles
24+
25+
# Disable legacy __init__.py behavior which is known to conflict with
26+
# modern python versions (3.9+)
27+
build --incompatible_default_to_explicit_init_py
28+
29+
# https://github.com/bazelbuild/bazel/issues/23043.
30+
build --incompatible_autoload_externally=
31+
32+
###############################################################################
33+
## Configuration Flags
34+
###############################################################################
35+
36+
###############################################################################
37+
## Custom user flags
38+
##
39+
## This should always be the last thing in the `.bazelrc` file to ensure
40+
## consistent behavior when setting flags in that file as `.bazelrc` files are
41+
## evaluated top to bottom.
42+
###############################################################################
43+
44+
try-import %workspace%/user.bazelrc

.bcr/config.yml

Whitespace-only changes.

.bcr/metadata.template.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"homepage": "https://github.com/abrisco/rules_tcl",
3+
"maintainers": [
4+
{
5+
"name": "Andre Brisco",
6+
"email": "91817010+abrisco@users.noreply.github.com",
7+
"github": "abrisco",
8+
"github_user_id": 91817010
9+
}
10+
],
11+
"repository": [
12+
"github:abrisco/rules_tcl"
13+
],
14+
"versions": [],
15+
"yanked_versions": {}
16+
}

.bcr/presubmit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
bcr_test_module:
3+
module_path: "."
4+
matrix:
5+
platform: ["macos_arm64", "ubuntu2004", "ubuntu2004_arm64"]
6+
bazel: ["7.x", "8.x"]
7+
tasks:
8+
run_tests:
9+
name: "Run test module"
10+
platform: ${{ platform }}
11+
bazel: ${{ bazel }}
12+
test_targets:
13+
- "--"
14+
- "//..."

.bcr/source.template.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"integrity": "",
3+
"strip_prefix": "",
4+
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{VERSION}/rules_tcl-{VERSION}.tar.gz"
5+
}

.github/github.bazelrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Bazel settings for use in Github CI
2+
3+
# Always display the flags being used
4+
common --announce_rc
5+
6+
# Show errors in CI
7+
test --test_output=errors
8+
9+
# Show more information about failures
10+
build --verbose_failures
11+
12+
# UI for cleaner CI output
13+
common --color=no
14+
common --show_timestamps

.github/release_notes.template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# {version}
2+
3+
```python
4+
bazel_dep(name = "rules_tcl", version = "{version}")
5+
```
6+
7+
Additional documentation can be found at: https://github.com/abrisco/rules_tcl

.github/workflows/ci.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
merge_group:
8+
pull_request:
9+
types:
10+
- opened
11+
- synchronize
12+
13+
env:
14+
BAZEL_STARTUP_FLAGS: --bazelrc=${{ github.workspace }}/.github/github.bazelrc
15+
16+
jobs:
17+
ci:
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
include:
22+
- os: macos-latest
23+
- os: ubuntu-24.04
24+
# - os: ubuntu-24.04-arm
25+
# - os: windows-2019
26+
steps:
27+
# Checkout the code
28+
- uses: actions/checkout@v4
29+
30+
- uses: bazel-contrib/setup-bazel@0.14.0
31+
with:
32+
bazelisk-cache: true
33+
disk-cache: ${{ github.workflow }}
34+
repository-cache: true
35+
36+
- name: Setup Bazelrc (Windows)
37+
run: |
38+
echo "TEMP=$env:RUNNER_TEMP" >> "$env:GITHUB_ENV"
39+
echo "TMP=$env:RUNNER_TEMP" >> "$env:GITHUB_ENV"
40+
echo "startup --output_user_root=D:/bzl" > ./user.bazelrc
41+
if: startswith(runner.os, 'Windows')
42+
- name: Setup Bazelrc
43+
run: |
44+
echo "common --keep_going" >> ./user.bazelrc
45+
46+
# Build and Test the code
47+
- name: Test (Unix)
48+
run: bazel ${BAZEL_STARTUP_FLAGS[@]} test //...
49+
if: startswith(runner.os, 'Windows') != true
50+
- name: Test (Windows)
51+
run: bazel $env:BAZEL_STARTUP_FLAGS test //...
52+
if: startswith(runner.os, 'Windows')
53+
54+
ci-format:
55+
runs-on: ubuntu-24.04
56+
steps:
57+
# Checkout the code
58+
- uses: actions/checkout@v4
59+
- uses: bazel-contrib/setup-bazel@0.14.0
60+
with:
61+
bazelisk-cache: true
62+
disk-cache: ${{ github.workflow }}
63+
repository-cache: true
64+
65+
- name: Buildifier
66+
run: |
67+
wget "https://github.com/bazelbuild/buildtools/releases/download/v${BUILDIFIER_VERSION}/buildifier-linux-amd64" -O buildifier
68+
chmod +x ./buildifier
69+
./buildifier -lint=warn -mode=check -warnings=all -r ${{ github.workspace }}
70+
rm ./buildifier
71+
env:
72+
BUILDIFIER_VERSION: 8.2.0

.github/workflows/docs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
docs:
10+
name: Docs
11+
permissions:
12+
contents: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@master
16+
- name: Run tests
17+
run: bazel run --compilation_mode=opt --stamp //docs:publish_book
18+
- name: Deploy to GitHub Pages
19+
uses: JamesIves/github-pages-deploy-action@4.1.7
20+
with:
21+
branch: gh-pages # The branch the action should deploy to.
22+
folder: docs/book # The folder the action should deploy.

.github/workflows/release.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# ---
2+
# name: Release
3+
# on:
4+
# workflow_dispatch:
5+
# push:
6+
# branches:
7+
# - main
8+
# paths:
9+
# # Only trigger for new releases
10+
# - "version.bzl"
11+
12+
# defaults:
13+
# run:
14+
# shell: bash
15+
16+
# env:
17+
# BAZEL_STARTUP_FLAGS: --bazelrc=${{ github.workspace }}/.github/github.bazelrc
18+
19+
# jobs:
20+
# release:
21+
# if: ${{ github.repository_owner == 'abrisco' }}
22+
# permissions:
23+
# contents: write
24+
# actions: write
25+
# attestations: write
26+
# runs-on: ubuntu-latest
27+
# steps:
28+
# - uses: actions/checkout@v2
29+
# with:
30+
# ref: main
31+
# - name: Detect the current version
32+
# run: |
33+
# version="$(grep 'VERSION =' ./version.bzl | sed 's/VERSION = "//' | sed 's/"//')"
34+
# echo "RELEASE_VERSION=${version}" >> $GITHUB_ENV
35+
# # Ensure this does not exclude the module used for the .bcr presubmit job.
36+
# - name: Create release artifact
37+
# run: |
38+
# tar -czf ${{ github.workspace }}/.github/rules_tcl.tar.gz --exclude=".git" --exclude=".github" -C ${{ github.workspace }} .
39+
# sha256_base64="$(shasum --algorithm 256 ${{ github.workspace }}/.github/rules_tcl.tar.gz | awk '{ print $1 }' | xxd -r -p | base64)"
40+
# echo "ARCHIVE_SHA256_BASE64=${sha256_base64}" >> "${GITHUB_ENV}"
41+
# - name: Generate release notes
42+
# run: |
43+
# # Generate the release notes
44+
# sed 's/{version}/${{env.RELEASE_VERSION}}/g' ${{ github.workspace }}/.github/release_notes.template \
45+
# | sed 's#{sha256_base64}#${{ env.ARCHIVE_SHA256_BASE64 }}#g' \
46+
# > ${{ github.workspace }}/.github/release_notes.txt
47+
# - name: Release
48+
# uses: softprops/action-gh-release@v1
49+
# id: rules_release
50+
# with:
51+
# generate_release_notes: true
52+
# tag_name: ${{ env.RELEASE_VERSION }}
53+
# body_path: ${{ github.workspace }}/.github/release_notes.txt
54+
# target_commitish: ${{ github.base_ref }}
55+
# - name: "Upload the rules archive"
56+
# uses: actions/upload-release-asset@v1
57+
# env:
58+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
# with:
60+
# upload_url: ${{ steps.rules_release.outputs.upload_url }}
61+
# asset_name: rules_tcl-${{ env.RELEASE_VERSION }}.tar.gz
62+
# asset_path: ${{ github.workspace }}/.github/rules_tcl.tar.gz
63+
# asset_content_type: application/gzip

0 commit comments

Comments
 (0)